mirror of
https://github.com/friendica/friendica
synced 2024-11-19 01:03:40 +00:00
Add time parameter for iOS Safari to stylesheet URL
This commit is contained in:
parent
f6092ebebb
commit
6d1bc974a0
1 changed files with 15 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
namespace Friendica\Core;
|
||||
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\System;
|
||||
|
||||
|
@ -191,11 +192,22 @@ class Theme
|
|||
*/
|
||||
public static function getStylesheetPath($theme)
|
||||
{
|
||||
$a = get_app();
|
||||
$a = BaseObject::getApp();
|
||||
|
||||
$query_params = [];
|
||||
|
||||
// Workaround for iOS Safari not initially sending the cookie for static files
|
||||
if ($a->mobileDetect->isIos() && $a->mobileDetect->isSafari()) {
|
||||
$query_params['t'] = time();
|
||||
}
|
||||
|
||||
if ($a->profile_uid) {
|
||||
$query_params['puid'] = $a->profile_uid;
|
||||
}
|
||||
|
||||
|
||||
$opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : '');
|
||||
if (file_exists('view/theme/' . $theme . '/style.php')) {
|
||||
return 'view/theme/' . $theme . '/style.pcss' . $opts;
|
||||
return 'view/theme/' . $theme . '/style.pcss' . (!empty($query_params) ? '?' . http_build_query($query_params) : '');
|
||||
}
|
||||
|
||||
return 'view/theme/' . $theme . '/style.css';
|
||||
|
|
Loading…
Reference in a new issue