Ticket #5604 (closed defect: duplicate)

Opened 6 months ago

Last modified 3 months ago

the_excerpt should strip style tags

Reported by: sunburntkamel Assigned to: anonymous
Priority: normal Milestone:
Component: General Version: 2.5
Severity: normal Keywords: the_excerpt, flickr, style, has_patch, needs_testing
Cc:

Description

the_excerpt prints <style> tags, rather than omitting them, causing unattractive excerpts.

example: http://archgfx.net/wordpress/?cat=1

the problem usually comes up in the context of posting from flickr.

Attachments

formatting.php.5604.patch (1.0 kB) - added by sunburntkamel on 01/10/08 16:15:55.
patch wp_trim_excerpt to strip style and script tags completely
formatting.php.5604.diff (0.8 kB) - added by sunburntkamel on 01/10/08 16:21:38.
patch wp_trim_excerpt to strip style and script tags completely

Change History

01/10/08 15:57:07 changed by sunburntkamel

it seems like wp_trim_excerpt might need something like this: http://us.php.net/manual/en/function.strip-tags.php#71962 but i'm really not qualified to make a patch.

01/10/08 16:15:55 changed by sunburntkamel

  • attachment formatting.php.5604.patch added.

patch wp_trim_excerpt to strip style and script tags completely

01/10/08 16:21:38 changed by sunburntkamel

  • attachment formatting.php.5604.diff added.

patch wp_trim_excerpt to strip style and script tags completely

01/10/08 16:22:35 changed by sunburntkamel

  • keywords changed from the_excerpt flickr style to the_excerpt flickr style has_patch.
  • component changed from Template to General.

ignore the first patch, my tabs weren't set correctly.

01/10/08 18:14:37 changed by sunburntkamel

  • keywords changed from the_excerpt flickr style has_patch to the_excerpt, flickr, style, has_patch.

01/10/08 18:18:13 changed by sunburntkamel

  • keywords changed from the_excerpt, flickr, style, has_patch to the_excerpt, flickr, style, has_patch, needs_testing.

01/10/08 18:28:19 changed by filosofo

I think filtering out everything between style tags (and CDATA) is a good idea, but it should probably be done for the content_save_pre filter, as this can also be a problem when someone posts by email, for example.

01/10/08 20:27:35 changed by sunburntkamel

I'm not sure that style/script tags should be removed from the posts entirely, as that might cause posts to not display properly.

03/26/08 06:35:25 changed by azaozz

  • status changed from new to closed.
  • resolution set to duplicate.
  • milestone deleted.

Closing as duplicate of #6380. The patches are very similar too.