Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#9199 closed defect (bug) (fixed)

\ is lost in post revisions

Reported by: hailin's profile hailin Owned by:
Milestone: 2.7.2 Priority: high
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

\ \add \sub etc in either title or content is lost in post revisions, and when restore from post revisions.

It's easy to test, eg, with the following simple post
title: test \
Content: hello \ and \add
\ is lost in every revision, and when restore from revision.

This creates big problems as many math expressions such as LaTeX
contains \ Many keywords begin with \
For example: \add \sub \multiple \left \right

The root cause is that wp_insert_post stripslahses, assuming slashes are added to the input. This is not the case when we read data from db. The fix I proposed here identified two such places and fixed this above issue.

Attachments (1)

9199_revision.diff (840 bytes) - added by hailin 16 years ago.
patch

Download all attachments as: .zip

Change History (3)

@hailin
16 years ago

patch

#1 @hailin
16 years ago

I want to thank Ryan for the discussion and suggesting fix for the first case.

#2 @ryan
16 years ago

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

(In [10620]) Escape before passing to insert/update post. Props hailin. fixes #9199 for trunk

Note: See TracTickets for help on using tickets.