WordPress.org

Make WordPress Core

Opened 16 years ago

Closed 15 years ago

Last modified 11 years ago

#1053 closed defect (bug) (fixed)

Slashes added to double-quotes in < pre > found in post content

Reported by: dsandler Owned by:
Milestone: Priority: normal
Severity: minor Version: 1.5
Component: General Keywords:
Focuses: Cc:

Description

Example post body (as entered in the admin pages, and verified by dumping the table in mysql):

<pre>'Singles' "Doubles"</pre>

As rendered on page (either in edit preview or on site itself):

<pre>'Singles' \"Doubles\"</pre>

Adding a call to stripslashes() to something like clean_pre() is the Wrong Thing To Do because it'll kill backslashes the user intended to be there.

A quick fix seems to involve adding a specific regexp for this case to clean_pre():

52a53

$text = str_replace('
"', '"', $text);

This seems to work for me, but I'm sure a more subtle fix is required to handle all cases.

Change History (5)

#1 @dsandler
16 years ago

  • Patch set to No

#2 @dsandler
16 years ago

Eww---I didn't expect Mantis to emit the HTML un-escaped in bug lists and whatnot. Someone with Super Cool Privileges will probably have to clean up the bug report. Sorry!

#3 @coffee2code
16 years ago

  • Summary changed from Slashes added to double-quotes in <pre> found in post content to Slashes added to double-quotes in &lt;pre> found in post content

#4 @coffee2code
16 years ago

  • Summary changed from Slashes added to double-quotes in &lt;pre> found in post content to Slashes added to double-quotes in < pre > found in post content

#5 @markjaquith
15 years ago

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

Fixed in [3049]

Note: See TracTickets for help on using tickets.