mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
add cache-buster to new login-background to force browser to load it
This commit is contained in:
parent
fc369fda68
commit
a594f9ccee
@ -297,7 +297,7 @@ class Login
|
||||
}
|
||||
else
|
||||
{
|
||||
return Api\Image::find('api',$chosen ? $chosen : 'login_background', '', null);
|
||||
return Api\Image::find('api', $chosen ? $chosen : 'login_background', '', true); // true: add cachebuster
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,10 +25,11 @@ class Image
|
||||
* @param string $app
|
||||
* @param string|array $image one or more image-name in order of precedence
|
||||
* @param string $extension ='' extension to $image, makes sense only with an array
|
||||
* @param boolean $add_cachebuster =false true: add a cachebuster to the returnd url
|
||||
*
|
||||
* @return string url of image or null if not found
|
||||
*/
|
||||
static function find($app,$image,$extension='')
|
||||
static function find($app,$image,$extension='',$add_cachebuster=false)
|
||||
{
|
||||
$image_map = self::map(null);
|
||||
|
||||
@ -37,7 +38,7 @@ class Image
|
||||
{
|
||||
foreach($image as $img)
|
||||
{
|
||||
if (($url = self::find($app, $img, $extension)))
|
||||
if (($url = self::find($app, $img, $extension, $add_cachebuster)))
|
||||
{
|
||||
return $url;
|
||||
}
|
||||
@ -51,21 +52,30 @@ class Image
|
||||
// instance specific images have highest precedence
|
||||
if (isset($image_map['vfs'][$image.$extension]))
|
||||
{
|
||||
return $webserver_url.$image_map['vfs'][$image.$extension];
|
||||
$url = $webserver_url.$image_map['vfs'][$image.$extension];
|
||||
}
|
||||
// then app specific ones
|
||||
if(isset($image_map[$app][$image.$extension]))
|
||||
elseif(isset($image_map[$app][$image.$extension]))
|
||||
{
|
||||
return $webserver_url.$image_map[$app][$image.$extension];
|
||||
$url = $webserver_url.$image_map[$app][$image.$extension];
|
||||
}
|
||||
// then api
|
||||
if(isset($image_map['api'][$image.$extension]))
|
||||
elseif(isset($image_map['api'][$image.$extension]))
|
||||
{
|
||||
return $webserver_url.$image_map['api'][$image.$extension];
|
||||
$url = $webserver_url.$image_map['api'][$image.$extension];
|
||||
}
|
||||
if(isset($image_map['phpgwapi'][$image.$extension]))
|
||||
elseif(isset($image_map['phpgwapi'][$image.$extension]))
|
||||
{
|
||||
return $webserver_url.$image_map['phpgwapi'][$image.$extension];
|
||||
$url = $webserver_url.$image_map['phpgwapi'][$image.$extension];
|
||||
}
|
||||
|
||||
if (!empty($url))
|
||||
{
|
||||
if ($add_cachebuster)
|
||||
{
|
||||
$url .= '?'.filemtime(EGW_SERVER_ROOT.substr($url, strlen($webserver_url)));
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
// if image not found, check if it has an extension and try withoug
|
||||
@ -73,7 +83,7 @@ class Image
|
||||
{
|
||||
$name = null;
|
||||
self::get_extension($image, $name);
|
||||
return self::find($app, $name, $extension);
|
||||
return self::find($app, $name, $extension, $add_cachebuster);
|
||||
}
|
||||
//error_log(__METHOD__."('$app', '$image', '$extension') image NOT found!");
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user