Make WordPress Core

Opened 20 years ago

Closed 20 years ago

#405 closed defect (bug) (fixed)

Trackback title format bungs up HTML entities

Reported by: offline's profile offline Owned by: ryan's profile ryan
Milestone: Priority: high
Severity: trivial Version:
Component: XML-RPC Keywords:
Focuses: Cc:


When tracking back to one of my own entries, I noticed the following:

I get a text string as a title that looks like this as the final output:

Offlingblog &raquo; Blog Archive &raquo; <title>

What's happening is the leading ampersand in the raquo; entity is being converted to an &amp; entity before tracking back, which is probably not the desired behaviour.

Change History (5)

#2 @MC_incubus
20 years ago

The same happens for PingBack titles. I've been trying to create a regex that would fix this... we need to look for &amp; followed by X chars and ";"

#3 @MC_incubus
20 years ago

  • Owner changed from anonymous to rboren
  • Patch set to No
  • Priority changed from normal to high
  • Status changed from new to assigned

#4 @MC_incubus
20 years ago

This fixes it... although it's a bandaid solution:

function clean_amp_chars($text){
$search = "/&amp;([a-zA-Z0-9#]{3,10});/i";
$replace = "&$1;";
$text = preg_replace($search, $replace, $text);
return $text;
add_filter('comment_author', 'clean_amp_chars', 100);
add_filter('comment_text', 'clean_amp_chars', 100);

#5 @matt
20 years ago

  • fixed_in_version set to 1.3
  • Resolution changed from 10 to 20
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.