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
Comment | File | Size | Author |
---|---|---|---|
#20 | D7-before.png | 23.49 KB | dcam |
#20 | D7-after.png | 29.85 KB | dcam |
#19 | feed_icon_1211668_19.patch | 1.76 KB | scito |
#16 | feed_icon_1211668_16.patch | 1.72 KB | bornholtz |
#12 | feed_icon_1211668_12.patch | 1.8 KB | scito |
Comments
Comment #1
scitoA patch which passes ! instead of @ to
t()
.Comment #2
scitoThis issue is small and separated.
Comment #3
c960657 CreditAttribution: c960657 commentedIt 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 .
Comment #4
Devin Carlson CreditAttribution: Devin Carlson commentedRerolled for D8.
Comment #5
c960657 CreditAttribution: c960657 commentedReviewed and tested. The patch in comment #1 applies to D7.
Comment #6
aspilicious CreditAttribution: aspilicious commentedThis needz a test so we don't break it again.
Comment #7
scitoI've added a unit test.
Comment #9
scitoStrange 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.
Comment #10
scito#7: feed_icon_1211668_7.patch queued for re-testing.
Comment #12
scitoI'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.
Comment #13
scito#12: feed_icon_1211668_12.patch queued for re-testing.
Comment #14
bornholtz CreditAttribution: bornholtz commented#12: feed_icon_1211668_12.patch queued for re-testing.
Comment #16
bornholtz CreditAttribution: bornholtz commentedUpdated to reflect change in test case locations
Comment #17
scitoTwo people that are working and agreeing on this minor issue should be enough. Setting RTBC.
Comment #18
Dries CreditAttribution: Dries commentedCommitted to 8.x. Moving to 7.x.
Comment #19
scitoBackported to 7.x
Comment #20
dcam CreditAttribution: dcam commentedI tested #19. The patch corrects the issue for me in 7.x. See the screenshots below.
Before
After
Comment #21
aspilicious CreditAttribution: aspilicious commentedLooks good
Comment #22
webchickAwesome, thanks for the helpful screenshots, and the test!
Committed and pushed to 7.x.