Core–shell nanomaterials for infection and cancer therapy