mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Img: allow for data urls
This commit is contained in:
parent
5a5cd9ba1e
commit
0ae1ed1319
13
library/vendor/ipl/Html/Img.php
vendored
13
library/vendor/ipl/Html/Img.php
vendored
@ -45,7 +45,12 @@ class Img extends BaseElement
|
||||
$this->url = $url;
|
||||
} else {
|
||||
if ($urlParams === null) {
|
||||
$this->url = Url::fromPath($url);
|
||||
if (is_string($url) && substr($url, 0, 5) === 'data:') {
|
||||
$this->url = $url;
|
||||
return;
|
||||
} else {
|
||||
$this->url = Url::fromPath($url);
|
||||
}
|
||||
} else {
|
||||
$this->url = Url::fromPath($url, $urlParams);
|
||||
}
|
||||
@ -59,7 +64,11 @@ class Img extends BaseElement
|
||||
*/
|
||||
public function getSrcAttribute()
|
||||
{
|
||||
return new Attribute('src', $this->getUrl()->getAbsoluteUrl('&'));
|
||||
if (is_string($this->url)) {
|
||||
return new Attribute('src', $this->url);
|
||||
} else {
|
||||
return new Attribute('src', $this->getUrl()->getAbsoluteUrl('&'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user