Make WordPress Core

Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#42729 closed enhancement (fixed)

Permit use of 'text-transform' in safecss_filter_attr()

Reported by: danielbachhuber's profile danielbachhuber Owned by: juiiee8487's profile juiiee8487
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: Cc:


As a WordPress user, I'd expect that whitelisting use of the style attribute for <span> elements would permit use of text-transform:lowercase; within the attribute.

However, doing so also requires filtering safe_style_css. Given text-transform is a text formatting property like font-style and text-decoration, it makes sense to also include it in safecss_filter_attr()'s default property set.

Attachments (2)

42729.diff (330 bytes) - added by juiiee8487 7 years ago.
I have created patch to whitelist text-transform CSS property.
42729.2.diff (3.3 KB) - added by birgire 6 years ago.

Download all attachments as: .zip

Change History (13)

#1 @danielbachhuber
7 years ago

  • Keywords good-first-bug added

7 years ago

I have created patch to whitelist text-transform CSS property.

#2 @juiiee8487
7 years ago

  • Keywords has-patch added; needs-patch removed

I have created patch 42729.diff to whitelist text-transform CSS property.

#3 @DrewAPicture
6 years ago

  • Owner set to juiiee8487
  • Status changed from new to assigned

Hi @juiiee8487, thanks for the patch! I've assigned this good-first-bug ticket to you to mark it as "claimed" and somebody should be along to review your patch and give you some feedback on next steps. Sorry for the delay in response.

#4 @juiiee8487
6 years ago

Hi @DrewAPicture, No problem! and Thank you! I am happy to own first ticket :)

6 years ago

#5 @birgire
6 years ago

  • Keywords has-unit-tests added; needs-unit-tests removed

The patch in 42729.diff looks good.

There are currently no explicit tests for the safecss_filter_attr() function.

The patch in 42729.2.diff

  • adds @since in the docblock of the safecss_filter_attr() function.
  • adds tests for the safecss_filter_attr() function with a data provider.

There's a suggested patch by @joehoyle in #24157 for tests, that we could also consider.

But it looks like that patch is blocked by the discussion of allowing parentheses.

#6 @SergeyBiryukov
6 years ago

  • Milestone changed from Future Release to 5.0

#7 @SergeyBiryukov
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 42880:

Formatting: Permit use of text-transform in safecss_filter_attr().

Add unit tests for safecss_filter_attr().

Props birgire, juiiee8487, danielbachhuber.
Fixes #42729.

#8 @johnbillion
6 years ago

  • Keywords good-first-bug removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

[42880] should be merged into 5.0. @since needs updating.

#9 @pento
6 years ago

  • Keywords needs-patch added; has-patch has-unit-tests removed
  • Milestone changed from 5.0 to 5.1

Gutenberg doesn't need text-transform, so I'm bumping this to 5.1. The version will still need to be updated.

#10 @desrosj
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 44531:

Docs: Update since annotation for text-transform support in safecss_filter_attr().

Introduced in [42880].

Fixes #42729.

#11 @desrosj
5 years ago

  • Keywords needs-patch removed
Note: See TracTickets for help on using tickets.