Problem/Motivation
Using the image style URL token I'm getting values like this:
http://localhost/sites/default/files/styles/small_square/public/some/path/image.jpg?h=209f3b97&itok=p0RR9BOl
Note the "&" in the value that ends in a broken image when the URL is used as img src.
As far I can see, tokens are HTML escaped by core when the callback returns a string value rather than a MarkupInterface impl.
Proposed resolution
Return the image style URL token value enclosed in a Markup object instead as simple string to prevent being escaped and therefore return a malformed URL.
Remaining tasks
- review
- check for other potential similar cases
- test
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
TBD.
Comments
Comment #2
manuel.adanComment #3
sascha_meissnerAdjusted patch #2 to work with 8.x-1.11
Comment #4
berdirComment #5
Manoj Raj.R commented#2 #3 both looks good for me.
Comment #6
heni_deepak commented#3 looks good to me. RTBC ?
test patches also pass 8.1 and in D9.5
Comment #7
metalboteSimple reroll
Comment #9
sascha_meissnerCreated a MR for convenience ;-)