If a site name is entered that contains an ampersand, then the feed icon's title attribute and alt text displays the encoded version of the ampersand.

Steps to Replicate:

1) Enter site name with ampersand through admin interface, ie 'Cats & Dogs'.
2) Hover over the feed icon on the front page.

Expected Behaviour:

3) Title text displays "Cats & Dogs"

Actual Behaviour:

3) Title text displays "Cats & amp ; Dogs"

The problem: The title text is encoded in function t() with @ parameter and later with drupal_attributes() in functions l()/theme_image().

A former similar issue for taxonomy terms: #973328: Special characters are encoded twice in taxonomy term title

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scito’s picture

Status: Active » Needs review
FileSize
723 bytes

A patch which passes ! instead of @ to t().

scito’s picture

Issue tags: +Novice

This issue is small and separated.

c960657’s picture

Status: Needs review » Needs work

It looks good, but it needs a reroll for D8.

If you want to help review a similar issue, check out #461938: Core should consistently filter_xss_admin() on $site_slogan and check_plain $site_name .

Devin Carlson’s picture

Status: Needs work » Needs review
FileSize
747 bytes

Rerolled for D8.

c960657’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed and tested. The patch in comment #1 applies to D7.

aspilicious’s picture

Status: Reviewed & tested by the community » Needs work

This needz a test so we don't break it again.

scito’s picture

Status: Needs work » Needs review
FileSize
1.76 KB
1.81 KB

I've added a unit test.

Status: Needs review » Needs work

The last submitted patch, feed_icon_1211668_7.patch, failed testing.

scito’s picture

Status: Needs work » Needs review

Strange exception:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupaltestbotmysql.simpletest111894semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => theme_registry:runtime:bartik:cache ) in lock_may_be_available() (line 167 of /var/lib/drupaltestbot/sites/default/files/checkout/core/includes/lock.inc).

The test is green on my local machine.
Let's try it again.

scito’s picture

Issue tags: -Novice, -Needs backport to D7

#7: feed_icon_1211668_7.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Novice, +Needs backport to D7

The last submitted patch, feed_icon_1211668_7.patch, failed testing.

scito’s picture

Status: Needs work » Needs review
FileSize
1.76 KB
1.8 KB

I've converted the tests from DrupalUnitTestCase to DrupalWebTestCase.
theme_feed_icon() could access the DB which causes problem for parallel executions.
Let's try this test.

scito’s picture

Issue tags: -Novice, -Needs backport to D7

#12: feed_icon_1211668_12.patch queued for re-testing.

bornholtz’s picture

#12: feed_icon_1211668_12.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Novice, +Needs backport to D7

The last submitted patch, feed_icon_1211668_12-D7.patch, failed testing.

bornholtz’s picture

Status: Needs work » Needs review
FileSize
1.72 KB

Updated to reflect change in test case locations

scito’s picture

Status: Needs review » Reviewed & tested by the community

Two people that are working and agreeing on this minor issue should be enough. Setting RTBC.

Dries’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to 8.x. Moving to 7.x.

scito’s picture

Status: Patch (to be ported) » Needs review
FileSize
1.76 KB

Backported to 7.x

dcam’s picture

FileSize
29.85 KB
23.49 KB

I tested #19. The patch corrects the issue for me in 7.x. See the screenshots below.

Before
D7-before.png

After
D7-after.png

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome, thanks for the helpful screenshots, and the test!

Committed and pushed to 7.x.

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