mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-15 01:39:30 +01:00
add cache-buster to new login-background to force browser to load it
This commit is contained in:
parent
3324b3a9fc
commit
38a308186c
@ -297,7 +297,7 @@ class Login
|
|||||||
}
|
}
|
||||||
else
|
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 $app
|
||||||
* @param string|array $image one or more image-name in order of precedence
|
* @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 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
|
* @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);
|
$image_map = self::map(null);
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ class Image
|
|||||||
{
|
{
|
||||||
foreach($image as $img)
|
foreach($image as $img)
|
||||||
{
|
{
|
||||||
if (($url = self::find($app, $img, $extension)))
|
if (($url = self::find($app, $img, $extension, $add_cachebuster)))
|
||||||
{
|
{
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
@ -51,21 +52,30 @@ class Image
|
|||||||
// instance specific images have highest precedence
|
// instance specific images have highest precedence
|
||||||
if (isset($image_map['vfs'][$image.$extension]))
|
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
|
// 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
|
// 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
|
// if image not found, check if it has an extension and try withoug
|
||||||
@ -73,7 +83,7 @@ class Image
|
|||||||
{
|
{
|
||||||
$name = null;
|
$name = null;
|
||||||
self::get_extension($image, $name);
|
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!");
|
//error_log(__METHOD__."('$app', '$image', '$extension') image NOT found!");
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user