mirror of
https://github.com/getgrav/grav.git
synced 2026-07-08 11:51:27 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user