Download & Extend

Special characters are encoded twice for feed icon attribute title

Project:Drupal core
Version:7.x-dev
Component:theme system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:needs backport to D7, Novice

Issue Summary

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

Comments

#1

Status:active» needs review

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

AttachmentSizeStatusTest resultOperations
theme_feed_icon-1211668-1.patch723 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 33,523 pass(es).View details

#2

Issue tags:+Novice

This issue is small and separated.

#3

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 .

#4

Status:needs work» needs review

Rerolled for D8.

AttachmentSizeStatusTest resultOperations
theme_feed_icon-1211668-4.patch747 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 34,133 pass(es).View details

#5

Status:needs review» reviewed & tested by the community

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

#6

Status:reviewed & tested by the community» needs work

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

#7

Status:needs work» needs review

I've added a unit test.

AttachmentSizeStatusTest resultOperations
feed_icon_1211668_7.patch1.81 KBIdleFAILED: [[SimpleTest]]: [MySQL] 34,321 pass(es), 0 fail(s), and 1 exception(es).View details
feed_icon_1211668_7-D7.patch1.76 KBIdleFAILED: [[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 details

#8

Status:needs review» needs work

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

#9

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.

#10

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

#11

Status:needs review» needs work

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

#12

Status:needs work» needs review

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.

AttachmentSizeStatusTest resultOperations
feed_icon_1211668_12.patch1.8 KBIdleFAILED: [[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 details
feed_icon_1211668_12-D7.patch1.76 KBIdleFAILED: [[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 details

#13

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

#14

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

#15

Status:needs review» needs work

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

#16

Status:needs work» needs review

Updated to reflect change in test case locations

AttachmentSizeStatusTest resultOperations
feed_icon_1211668_16.patch1.72 KBIdlePASSED: [[SimpleTest]]: [MySQL] 37,058 pass(es).View details

#17

Status:needs review» reviewed & tested by the community

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

#18

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.

#19

Status:patch (to be ported)» needs review

Backported to 7.x

AttachmentSizeStatusTest resultOperations
feed_icon_1211668_19.patch1.76 KBIdlePASSED: [[SimpleTest]]: [MySQL] 39,223 pass(es).View details

#20

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

AttachmentSizeStatusTest resultOperations
D7-before.png23.49 KBIgnored: Check issue status.NoneNone
D7-after.png29.85 KBIgnored: Check issue status.NoneNone

#21

Status:needs review» reviewed & tested by the community

Looks good

#22

Status:reviewed & tested by the community» fixed

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

Committed and pushed to 7.x.

#23

Status:fixed» closed (fixed)

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