Page MenuHomePhabricator

srcset uses incorrect radix character
Closed, DuplicatePublic

Description

The main image link on the file page in my setup has a "1,5x," in the srcset attribute of the img tag. It should be "1.5x," instead. Because of this, none of my files are showing correctly in the "File:..." pages nor as thumbs in the Wiki pages. The thumb does work correctly in the "File:" page as do links to other image resolutions.

Event Timeline

TheDJ created this task.Dec 24 2017, 12:27 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 24 2017, 12:27 PM
TheDJ added a comment.Dec 24 2017, 1:35 PM

I guess this is due to LC_NUMERIC being set to his french number format.

There is a foreach loop in Html::srcSet that does

// Cast density to float to strip 'x', then back to string to serve
$density = (string)(float)$density;

which indirectly causes this. We could either use number_format, but then we end up with 1.0x instead of 1x, or I guess we can do character replacement...
Neither is particularly ideal really...

Magol added a subscriber: Magol.Jun 15 2018, 10:23 AM