Opened 21 years ago
Closed 21 years ago
#405 closed defect (bug) (fixed)
Trackback title format bungs up HTML entities
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | trivial | Version: | |
Component: | XML-RPC | Keywords: | |
Focuses: | Cc: |
Description
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 » Blog Archive » <title>
What's happening is the leading ampersand in the raquo; entity is being converted to an & entity before tracking back, which is probably not the desired behaviour.
Change History (5)
#3
@
21 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
@
21 years ago
This fixes it... although it's a bandaid solution:
function clean_amp_chars($text){
$search = "/&([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);
Note: See
TracTickets for help on using
tickets.
The same happens for PingBack titles. I've been trying to create a regex that would fix this... we need to look for & followed by X chars and ";"