I could have sworn I filed a patch for this somewhere a long time ago, but maybe I didn't.

The shortcut_set_title() function, which is a title callback for the page for editing a shortcut set, runs check_plain() on the title. This isn't necessary, though, since the menu system already sanitizes titles for us. So the result is that the title is double-escaped.

In theory this should be backported to D7 also, but I'm not sure we should due to the security implications (in case other code out there is calling this function in places where it really does need to be escaped).

Comments

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

RTBC for D8

dries’s picture

Do we even need that helper function?

David_Rothstein’s picture

Currently it's a separate function because it's used as a menu item title callback.

It could probably be removed and the page title set via drupal_set_title(), but I thought that was not considered best practice (harder to alter, etc)...

xjm’s picture

Yeah, using drupal_set_title() directly causes a few problems, so I think having the title callback is good.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Yeah if anything we should work towards deprecating drupal_set_title(), it has similar problems compared to drupal_add_css() vs. #attached. Committed/pushed to 8.x.

David_Rothstein’s picture

Version: 8.x-dev » 7.x-dev
Status: Fixed » Needs review
StatusFileSize
new1.8 KB

Actually, here's a safe way to backport this to Drupal 7.

xjm’s picture

#6: shortcut-set-title-1363358-6.patch queued for re-testing.

xjm’s picture

Status: Needs review » Reviewed & tested by the community

The backport looks safe to me.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the review! Committed to 7.x - http://drupalcode.org/project/drupal.git/commit/ca06374

David_Rothstein’s picture

Actually I just realized the end result of this issue is that we need a change notification for Drupal 8. I created one at http://drupal.org/node/1762604

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

David_Rothstein’s picture

Issue tags: +7.17 release notes

Drupal 7.16 was a security release only, so this issue is now scheduled for Drupal 7.17 instead.

Fixing tags accordingly.

liam morland’s picture