From: Hypolite Petovan Date: Sat, 1 Feb 2020 00:41:20 +0000 (-0500) Subject: Append version parameter to script and stylesheets paths in App\Page X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=42990ac0f4371d1c9b27be0ae2b81c4a077d076f;p=friendica.git Append version parameter to script and stylesheets paths in App\Page --- diff --git a/src/App/Page.php b/src/App/Page.php index 8dd8763465..4b1929a998 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -15,6 +15,7 @@ use Friendica\Core\Renderer; use Friendica\Core\Theme; use Friendica\Module\Special\HTTPException as ModuleHTTPException; use Friendica\Network\HTTPException; +use Friendica\Util\Network; use Friendica\Util\Strings; /** @@ -151,6 +152,8 @@ class Page implements ArrayAccess */ public function registerStylesheet($path) { + $path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]); + if (mb_strpos($path, $this->basePath . DIRECTORY_SEPARATOR) === 0) { $path = mb_substr($path, mb_strlen($this->basePath . DIRECTORY_SEPARATOR)); } @@ -334,6 +337,8 @@ class Page implements ArrayAccess */ public function registerFooterScript($path) { + $path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]); + $url = str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path); $this->footerScripts[] = trim($url, '/');