WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 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:

Description

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)

comment:2 ryan10 years ago

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

comment:3 ryan10 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

comment:4 TechGnome10 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.

TG

comment:5 ryan10 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.