Ticket #3755 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

wp_title function: filter post title before stripping tags

Reported by: jhodgdon Assigned to: rob1n
Priority: normal Milestone: 2.2.1
Component: General Version: 2.1
Severity: normal Keywords: filter, wp_title, strip_tags, has-patch
Cc: jhodgdon

Description

At least one plugin (Polyglot) uses special (fake HTML) tags for filtering purposes. In most places in WordPress, filters are called before stripping HTML tags out of titles. However, in the wp_title function, strip_tags is called before apply_filters, so the filtering does not work.

Patch about to be added...

Attachments

general-template.php.diff (0.6 kB) - added by jhodgdon on 02/06/07 15:54:20.
Patch to wp_title function: strip tags after filtering post title
general-template-php4.diff (0.6 kB) - added by jhodgdon on 06/01/07 17:53:48.
Diff for re-patch of the fix that was submitted so it will actually work

Change History

02/06/07 15:54:20 changed by jhodgdon

  • attachment general-template.php.diff added.

Patch to wp_title function: strip tags after filtering post title

02/07/07 01:33:37 changed by ryan

1

02/23/07 00:54:07 changed by jhodgdon

  • keywords changed from filter, wp_title, stip_tags to filter, wp_title, strip_tags, has-patch.

03/10/07 04:06:48 changed by jhodgdon

Still unpatched in [5012], same problem still there.

03/10/07 05:13:42 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [5014]) apply filter before stripping tags. Props jhodgdon. fixes #3755

06/01/07 17:53:02 changed by jhodgdon

  • cc set to jhodgdon.
  • status changed from closed to reopened.
  • resolution deleted.

I just noticed that the way the patch was applied here, the function is still broken. The current file says ([5619] of general-template.php):

229 $title = apply_filters('single_post_title', $title);

230 $title = strip_tags($post->post_title);

As you can see, the second line overrides the first line. It should be (as it was in the original patch):

229 $title = apply_filters('single_post_title', $post->post_title);

230 $title = strip_tags($title);

I am submitting a new patch to fix this patch... will attach shortly...

Jennifer

06/01/07 17:53:48 changed by jhodgdon

  • attachment general-template-php4.diff added.

Diff for re-patch of the fix that was submitted so it will actually work

06/01/07 20:06:56 changed by rob1n

  • owner changed from anonymous to rob1n.
  • status changed from reopened to new.

06/01/07 22:52:33 changed by rob1n

  • milestone changed from 2.2 to 2.2.1.

06/01/07 22:54:46 changed by rob1n

  • status changed from new to closed.
  • resolution set to fixed.

(In [5625]) Fix wp_title single post title filters. Props jhodgdon. fixes #3755