Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#6 closed defect (bug) (fixed)

the_excerpt() on non-excerpt posts doesn't stripslashes

Reported by: anonymousbugger Owned by: ryan
Milestone: Priority: normal
Severity: minor Version:
Component: Template Keywords:
Focuses: Cc:


In trying to use the th_excerpt() function of WP, I noticed that my tick marks were still escaped. The key to this is that there was no excerpt entered for the posts.
Review of the code revealed that if there is an excerpt, it gets stripslashes, but when there is no exceprt, it attempts to use the post content. The check for empty excerpt isn't done until after the call to stripslashes. this means that when the content is used, it doesn't go through the stripslashes, causing them to show in the "faked" excerpt.

Change History (6)

#2 @ryan
17 years ago

  • Owner changed from anonymous to rboren
  • Status changed from new to assigned

#3 @ryan
17 years ago

I cannot reproduce this with CVS. stripslashes should not be necessary. We'll be removing almost every call to stripslashes sometime soon. Posts saved with older versions of Wordpress had double slashes added to them. These old posts will show up with slashes. A script to strip extra slashes present in old posts is in the works.

edited on: 06-11-04 11:00

#4 @TechGnome
17 years ago

I guess I should have mentioned that I am using 1.2 Mingus...
Ok, if it's fixed in the CVS, I'll grab that file and see if the problem persists. The note about older versions of WP probably holds true for my case too. Ahhhh the joys of development.


#5 @ryan
17 years ago

  • Resolution changed from 10 to 20
  • Status changed from assigned to closed

Resolving. There isn't really one file that will fix this. The changes are widespread. I'll create a separate bug to track the problem with extra slashes in old posts.

Note: See TracTickets for help on using tickets.