1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-18 04:22:10 +02:00

changed the return of webpUrl()

to return the calculated URL, even if there is no webp copy available!
This commit is contained in:
horst-n
2019-05-04 18:42:11 +02:00
parent 88d4b11db4
commit 6e580f71e1

View File

@@ -181,15 +181,12 @@ class Pageimage extends Pagefile {
}
/**
* Return the web accessible URL to this image files webP dependency
* Return the web accessible URL to this image files webP dependency, also if no webp copy exists!
*
* @return string
*
*/
public function webpUrl() {
if(!$this->hasWebp()) {
return '#'; // @Ryan: what should be returned for none existing webp variations here?
}
$path_parts = pathinfo($this->url);
$webpUrl = $path_parts['dirname'] . '/' . $path_parts['filename'] . '.webp';
return $webpUrl;