aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/PageBuilder.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam+github@flibidi.net>2017-10-06 14:32:07 +0200
committerGitHub <noreply@github.com>2017-10-06 14:32:07 +0200
commitc8d96b4729a96ff2321862ca13a727658860e7a5 (patch)
treeb9d19abb6351f972027dc8301d9869ba04ae45ea /application/PageBuilder.php
parentb3e39bf57ecf0f92357b1f15051cf2e9d3f1b267 (diff)
parentb3e1f92e9cd0cae35bc726ca3a2356b4e631ccfa (diff)
downloadShaarli-c8d96b4729a96ff2321862ca13a727658860e7a5.tar.gz
Shaarli-c8d96b4729a96ff2321862ca13a727658860e7a5.tar.zst
Shaarli-c8d96b4729a96ff2321862ca13a727658860e7a5.zip
Merge pull request #979 from ArthurHoaro/feature/assets-cache-version
Add a version hash for asset loading to prevent browser's cache issue
Diffstat (limited to 'application/PageBuilder.php')
-rw-r--r--application/PageBuilder.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/application/PageBuilder.php b/application/PageBuilder.php
index 7a42400d..291860ad 100644
--- a/application/PageBuilder.php
+++ b/application/PageBuilder.php
@@ -49,7 +49,7 @@ class PageBuilder
49 49
50 try { 50 try {
51 $version = ApplicationUtils::checkUpdate( 51 $version = ApplicationUtils::checkUpdate(
52 shaarli_version, 52 SHAARLI_VERSION,
53 $this->conf->get('resource.update_check'), 53 $this->conf->get('resource.update_check'),
54 $this->conf->get('updates.check_updates_interval'), 54 $this->conf->get('updates.check_updates_interval'),
55 $this->conf->get('updates.check_updates'), 55 $this->conf->get('updates.check_updates'),
@@ -75,7 +75,11 @@ class PageBuilder
75 } 75 }
76 $this->tpl->assign('searchcrits', $searchcrits); 76 $this->tpl->assign('searchcrits', $searchcrits);
77 $this->tpl->assign('source', index_url($_SERVER)); 77 $this->tpl->assign('source', index_url($_SERVER));
78 $this->tpl->assign('version', shaarli_version); 78 $this->tpl->assign('version', SHAARLI_VERSION);
79 $this->tpl->assign(
80 'version_hash',
81 ApplicationUtils::getVersionHash(SHAARLI_VERSION, $this->conf->get('credentials.salt'))
82 );
79 $this->tpl->assign('scripturl', index_url($_SERVER)); 83 $this->tpl->assign('scripturl', index_url($_SERVER));
80 $this->tpl->assign('privateonly', !empty($_SESSION['privateonly'])); // Show only private links? 84 $this->tpl->assign('privateonly', !empty($_SESSION['privateonly'])); // Show only private links?
81 $this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly'])); 85 $this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly']));
@@ -89,6 +93,7 @@ class PageBuilder
89 $this->tpl->assign('feed_type', $this->conf->get('feed.show_atom', true) !== false ? 'atom' : 'rss'); 93 $this->tpl->assign('feed_type', $this->conf->get('feed.show_atom', true) !== false ? 'atom' : 'rss');
90 $this->tpl->assign('hide_timestamps', $this->conf->get('privacy.hide_timestamps', false)); 94 $this->tpl->assign('hide_timestamps', $this->conf->get('privacy.hide_timestamps', false));
91 $this->tpl->assign('token', getToken($this->conf)); 95 $this->tpl->assign('token', getToken($this->conf));
96
92 if ($this->linkDB !== null) { 97 if ($this->linkDB !== null) {
93 $this->tpl->assign('tags', $this->linkDB->linksCountPerTag()); 98 $this->tpl->assign('tags', $this->linkDB->linksCountPerTag());
94 } 99 }