WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#16905 closed defect (bug) (duplicate)

sanitize_title calls remove_accents before applying filters

Reported by: texttheater Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: General Keywords:
Focuses: Cc:
PR Number:

Description

As of r15929, sanitize_title in formatting.php calls remove_accents directly. remove_accents used to be called in sanitize_title_with_dashes, which in turn is one of the default filters applied in sanitize_title. The change takes away the possibility for plugins to change the title using a filter before accents are removed, or to avoid removing accents altogether.

One of the plugins broken by the change is my German Slugs.

Related tickets:

  • #9591, where the change originated
  • #15248, where unsalkorkmaz has a similar complaint that could at least have been worked around before the change, now there seems to be no chance to do so using the plugin API
  • #9492, where the deeper issue with WordPress indiscriminately removing diacritics (that's right, not all diacritics are mere accents, remove_accents is a misnomer) is addressed. With that I think one can live – as long as it remains possible to fix it via the plugin API.

Attachments (3)

16905.patch (665 bytes) - added by hakre 9 years ago.
make remove_accent() filterable
16905.2.patch (669 bytes) - added by hakre 9 years ago.
Call sanitize title prior remove_accents
16905.3.patch (541 bytes) - added by hakre 9 years ago.
Just an idea

Download all attachments as: .zip

Change History (12)

#1 @texttheater
9 years ago

  • Cc poststelle@… added

#2 @hakre
9 years ago

Gotta take a look, thanks for reporting.

Related: #9492

@hakre
9 years ago

make remove_accent() filterable

#3 @hakre
9 years ago

That's just a first idea. This does not re-instates the default behaviour and I think it's of general limited use.

For me it's unclear right now when remove_accents() had been invoked previously.

@hakre
9 years ago

Call sanitize title prior remove_accents

#4 @hakre
9 years ago

$raw_title is available as second parameter passed to the sanitize_title filter.

AFAIK it has the original title and should help you to override any changes remove_accent() already has done.

Isn't it suitable for your workarounds?

@hakre
9 years ago

Just an idea

#5 @hakre
9 years ago

Probably it's better to normalize the data in remove_accents() and make the transliteration table overload-able - Related: #16908

#6 @toscho
9 years ago

  • Cc info@… added
  • Keywords close added
  • Resolution set to invalid
  • Status changed from new to closed

See #16642 for a discussion of this issue and my code for a solution. No need to change anything.

#7 @ocean90
9 years ago

  • Keywords close removed
  • Resolution invalid deleted
  • Status changed from closed to reopened

#8 @ocean90
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from reopened to closed

#9 @texttheater
9 years ago

Thanks for pointing me to $raw_title, that does make a workaround possible.

Note: See TracTickets for help on using tickets.