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

Files: 
CommentFileSizeAuthor
#20 D7-before.png23.49 KBdcam
#20 D7-after.png29.85 KBdcam
#19 feed_icon_1211668_19.patch1.76 KBscito
PASSED: [[SimpleTest]]: [MySQL] 39,223 pass(es).
[ View ]
#16 feed_icon_1211668_16.patch1.72 KBbornholtz
PASSED: [[SimpleTest]]: [MySQL] 37,058 pass(es).
[ View ]
#12 feed_icon_1211668_12.patch1.8 KBscito
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feed_icon_1211668_12.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#12 feed_icon_1211668_12-D7.patch1.76 KBscito
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feed_icon_1211668_12-D7.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#7 feed_icon_1211668_7.patch1.81 KBscito
FAILED: [[SimpleTest]]: [MySQL] 34,321 pass(es), 0 fail(s), and 1 exception(es).
[ View ]
#7 feed_icon_1211668_7-D7.patch1.76 KBscito
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feed_icon_1211668_7-D7.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#4 theme_feed_icon-1211668-4.patch747 bytesDevin Carlson
PASSED: [[SimpleTest]]: [MySQL] 34,133 pass(es).
[ View ]
#1 theme_feed_icon-1211668-1.patch723 bytesscito
PASSED: [[SimpleTest]]: [MySQL] 33,523 pass(es).
[ View ]

Comments

scito’s picture

Status:Active» Needs review
StatusFileSize
new723 bytes
PASSED: [[SimpleTest]]: [MySQL] 33,523 pass(es).
[ View ]

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
StatusFileSize
new747 bytes
PASSED: [[SimpleTest]]: [MySQL] 34,133 pass(es).
[ View ]

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
StatusFileSize
new1.76 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feed_icon_1211668_7-D7.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
new1.81 KB
FAILED: [[SimpleTest]]: [MySQL] 34,321 pass(es), 0 fail(s), and 1 exception(es).
[ View ]

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

#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
StatusFileSize
new1.76 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feed_icon_1211668_12-D7.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
new1.8 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feed_icon_1211668_12.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

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

#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
StatusFileSize
new1.72 KB
PASSED: [[SimpleTest]]: [MySQL] 37,058 pass(es).
[ View ]

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
StatusFileSize
new1.76 KB
PASSED: [[SimpleTest]]: [MySQL] 39,223 pass(es).
[ View ]

Backported to 7.x

dcam’s picture

StatusFileSize
new29.85 KB
new23.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.