Small bugfix for responsive images (#2300)

* Replace spaces in image filename with %20 to avoid parse errors with the srcset attribute

* Update system/src/Grav/Common/Page/Medium/ImageMedium.php

Co-Authored-By: ranitham <ranitha.m@gmail.com>
This commit is contained in:
ranitham
2019-01-08 15:34:00 +11:00
committed by Andy Miller
parent 680bfef2c3
commit 394dfad566

View File

@@ -223,7 +223,7 @@ class ImageMedium extends Medium
foreach ($this->alternatives as $ratio => $medium) {
$srcset[] = $medium->url($reset) . ' ' . $medium->get('width') . 'w';
}
$srcset[] = $this->url($reset) . ' ' . $this->get('width') . 'w';
$srcset[] = str_replace(' ', '%20', $this->url($reset)) . ' ' . $this->get('width') . 'w';
return implode(', ', $srcset);
}