Page MenuHomePhabricator

Mediawiki. Html::srcSet(...). Invalid srcset creation depending on $wgShellLocale setting.
Closed, DuplicatePublic

Description

  • Mediawiki 1.31.1.
  • tested with current FireFox 64.0/64-bit.
  • In LocalSettings.php set
$wgShellLocale = "de_DE.utf8";
$wgResponsiveImages = true;
  • Upload an image, e.g. 'Osmbanner2.png'.
  • In a page (editing) insert

[[File:Osmbanner2.png|none|middle|frame]]
AND
[[File:Osmbanner2.png|none|middle|thumb]]

  • Save the page.
  • Result: First image is displayed.

Second one not. One see only the ALT-Text.

  • Reason: Output of the image contains an invalid comma (1,5x) instead of a dot (1.5x) in srcset part
<div class="thumb tnone">
 <div class="thumbinner" style="width:302px;">
  <a href="/index.php?title=Datei:Osmbanner2.png" class="image">

   <img alt="Osmbanner2.png" src="/images/thumb/9/92/Osmbanner2.png/300px-Osmbanner2.png" class="thumbimage"
    srcset="/images/thumb/9/92/Osmbanner2.png/450px-Osmbanner2.png 1,5x
    
    ... and so on ...
  • In file includes/Html.php line 1044:
$density = (string)(float)$density;

The float function is processed with german locale.

Event Timeline

Illovo created this task.Jan 4 2019, 3:14 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 4 2019, 3:14 PM
Illovo updated the task description. (Show Details)Jan 4 2019, 3:16 PM
Illovo updated the task description. (Show Details)

Hi @Illovo, thanks for taking the time to report this! Merging into T181987