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, '/'); diff --git a/src/Util/Network.php b/src/Util/Network.php index e2cfc3e849..17ddd048a5 100644 --- a/src/Util/Network.php +++ b/src/Util/Network.php @@ -870,4 +870,27 @@ class Network return $url; } + + /** + * Adds query string parameters to the provided URI. Replace the value of existing keys. + * + * @param string $path + * @param array $additionalParams Associative array of parameters + * @return string + */ + public static function appendQueryParam(string $path, array $additionalParams) + { + $parsed = parse_url($path); + + $params = []; + if (!empty($parsed['query'])) { + parse_str($parsed['query'], $params); + } + + $params = array_merge($params, $additionalParams); + + $parsed['query'] = http_build_query($params); + + return self::unparseURL($parsed); + } } diff --git a/view/templates/admin/federation.tpl b/view/templates/admin/federation.tpl index 9850a37414..177d5406f6 100644 --- a/view/templates/admin/federation.tpl +++ b/view/templates/admin/federation.tpl @@ -1,4 +1,4 @@ - +

{{$title}} - {{$page}}

diff --git a/view/templates/event_head.tpl b/view/templates/event_head.tpl index baa031f048..463ba720e2 100644 --- a/view/templates/event_head.tpl +++ b/view/templates/event_head.tpl @@ -1,8 +1,8 @@ - - - - + + + + - + + - - - - - - - - - - - - + + + + + + + + + + + + + - + - + \ No newline at end of file + \ No newline at end of file diff --git a/view/templates/settings/profile/photo/crop_head.tpl b/view/templates/settings/profile/photo/crop_head.tpl index 3fd15796e2..357cc1861c 100644 --- a/view/templates/settings/profile/photo/crop_head.tpl +++ b/view/templates/settings/profile/photo/crop_head.tpl @@ -1,2 +1,2 @@ - - + + diff --git a/view/theme/duepuntozero/templates/theme_settings.tpl b/view/theme/duepuntozero/templates/theme_settings.tpl index a5f406f7a9..f7052e77f0 100644 --- a/view/theme/duepuntozero/templates/theme_settings.tpl +++ b/view/theme/duepuntozero/templates/theme_settings.tpl @@ -1,4 +1,4 @@ - + {{include file="field_select.tpl" field=$colorset}} diff --git a/view/theme/frio/templates/admin/blocklist/contact.tpl b/view/theme/frio/templates/admin/blocklist/contact.tpl index 59f02dba56..d8b209640d 100644 --- a/view/theme/frio/templates/admin/blocklist/contact.tpl +++ b/view/theme/frio/templates/admin/blocklist/contact.tpl @@ -1,5 +1,5 @@ - - + +

{{$title}} - {{$page}}

diff --git a/view/theme/frio/templates/admin/site.tpl b/view/theme/frio/templates/admin/site.tpl index 12ea0b83a4..e13b2960e0 100644 --- a/view/theme/frio/templates/admin/site.tpl +++ b/view/theme/frio/templates/admin/site.tpl @@ -18,7 +18,7 @@ }); }); - +

{{$title}} - {{$page}}

diff --git a/view/theme/frio/templates/admin/users.tpl b/view/theme/frio/templates/admin/users.tpl index fb2a49f679..256d5cdaec 100644 --- a/view/theme/frio/templates/admin/users.tpl +++ b/view/theme/frio/templates/admin/users.tpl @@ -1,5 +1,5 @@ - - + +

{{$title}} - {{$page}}

diff --git a/view/theme/frio/templates/contacts-head.tpl b/view/theme/frio/templates/contacts-head.tpl index d51d76b44a..ebdf2a29a8 100644 --- a/view/theme/frio/templates/contacts-head.tpl +++ b/view/theme/frio/templates/contacts-head.tpl @@ -1,2 +1,2 @@ - + diff --git a/view/theme/frio/templates/event_form.tpl b/view/theme/frio/templates/event_form.tpl index c48d5c7fc8..1d4f26a6bd 100644 --- a/view/theme/frio/templates/event_form.tpl +++ b/view/theme/frio/templates/event_form.tpl @@ -1,5 +1,5 @@ - +

{{$title}}

diff --git a/view/theme/frio/templates/event_head.tpl b/view/theme/frio/templates/event_head.tpl index 43c7be9441..cb1a4685bd 100644 --- a/view/theme/frio/templates/event_head.tpl +++ b/view/theme/frio/templates/event_head.tpl @@ -1,10 +1,10 @@ - - - - - - + + + + + + +
{{if $editable == 1}} diff --git a/view/theme/frio/templates/head.tpl b/view/theme/frio/templates/head.tpl index eea3e738a5..b539a90d96 100644 --- a/view/theme/frio/templates/head.tpl +++ b/view/theme/frio/templates/head.tpl @@ -7,31 +7,31 @@ {{* All needed css files - Note: css must be inserted before js files *}} - - - - - + + + + + - - - - - - - - - - - + + + + + + + + + + + {{foreach $stylesheets as $stylesheetUrl}} {{/foreach}} {{* own css files *}} - - + + @@ -51,40 +51,40 @@ {{* The js files we use *}} - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + {{* own js files *}} - - + + {{if ! $block_public}} - + {{/if}} - + {{* Include the strings which are needed for some js functions (e.g. translation) They are loaded into the html so that js functions can use them *}} diff --git a/view/theme/frio/templates/jot-header.tpl b/view/theme/frio/templates/jot-header.tpl index 67b136ae16..f9e10ca8cd 100644 --- a/view/theme/frio/templates/jot-header.tpl +++ b/view/theme/frio/templates/jot-header.tpl @@ -1,7 +1,7 @@ - - - + + + - + +
{{include file="section_title.tpl" title=$header}} diff --git a/view/theme/frio/templates/photos_head.tpl b/view/theme/frio/templates/photos_head.tpl index 965245aea6..8399b413c1 100644 --- a/view/theme/frio/templates/photos_head.tpl +++ b/view/theme/frio/templates/photos_head.tpl @@ -1,5 +1,5 @@ - + diff --git a/view/theme/frio/templates/theme_settings.tpl b/view/theme/frio/templates/theme_settings.tpl index 9c32558b8e..c3456a484f 100644 --- a/view/theme/frio/templates/theme_settings.tpl +++ b/view/theme/frio/templates/theme_settings.tpl @@ -1,5 +1,5 @@ - - + + {{include file="field_select.tpl" field=$scheme}} diff --git a/view/theme/frio/templates/threaded_conversation.tpl b/view/theme/frio/templates/threaded_conversation.tpl index f8e2222902..b1039d9473 100644 --- a/view/theme/frio/templates/threaded_conversation.tpl +++ b/view/theme/frio/templates/threaded_conversation.tpl @@ -1,5 +1,5 @@ - -{{if $mode == display}}{{/if}} + +{{if $mode == display}}{{/if}} {{$live_update nofilter}} diff --git a/view/theme/quattro/templates/events_reminder.tpl b/view/theme/quattro/templates/events_reminder.tpl index 49846cbfa5..d0bc1f481c 100644 --- a/view/theme/quattro/templates/events_reminder.tpl +++ b/view/theme/quattro/templates/events_reminder.tpl @@ -1,8 +1,8 @@ - - - - + + + + + {{include file="field_select.tpl" field=$color}} diff --git a/view/theme/smoothly/templates/bottom.tpl b/view/theme/smoothly/templates/bottom.tpl index a5c13e0bf4..d68320716e 100644 --- a/view/theme/smoothly/templates/bottom.tpl +++ b/view/theme/smoothly/templates/bottom.tpl @@ -1,5 +1,5 @@ - + - - + + + +