aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-28 14:08:08 +0100
committerGitHub <noreply@github.com>2020-10-28 14:08:08 +0100
commit1ca7ddd76bc5736b69e878ef1c6b96b77b084366 (patch)
tree0f360275941bd5c7b55f820d92451d22cde8eb0b
parentd2bb40cc7ca2a7f9c2403087016a0050a7113e07 (diff)
parentd3f6d525253eb7bb041d9436cbf213c10524a85c (diff)
downloadShaarli-1ca7ddd76bc5736b69e878ef1c6b96b77b084366.tar.gz
Shaarli-1ca7ddd76bc5736b69e878ef1c6b96b77b084366.tar.zst
Shaarli-1ca7ddd76bc5736b69e878ef1c6b96b77b084366.zip
Merge pull request #1614 from ArthurHoaro/hotfix/php71-compat-login
Fix compatiliby issue on login with PHP 7.1
-rw-r--r--application/render/PageBuilder.php2
-rw-r--r--application/security/SessionManager.php7
2 files changed, 6 insertions, 3 deletions
diff --git a/application/render/PageBuilder.php b/application/render/PageBuilder.php
index 25e0e284..c2fae705 100644
--- a/application/render/PageBuilder.php
+++ b/application/render/PageBuilder.php
@@ -160,7 +160,7 @@ class PageBuilder
160 160
161 $this->tpl->assign('formatter', $this->conf->get('formatter', 'default')); 161 $this->tpl->assign('formatter', $this->conf->get('formatter', 'default'));
162 162
163 $this->tpl->assign('links_per_page', $this->session['LINKS_PER_PAGE']); 163 $this->tpl->assign('links_per_page', $this->session['LINKS_PER_PAGE'] ?? 20);
164 164
165 // To be removed with a proper theme configuration. 165 // To be removed with a proper theme configuration.
166 $this->tpl->assign('conf', $this->conf); 166 $this->tpl->assign('conf', $this->conf);
diff --git a/application/security/SessionManager.php b/application/security/SessionManager.php
index 36df8c1c..96bf193c 100644
--- a/application/security/SessionManager.php
+++ b/application/security/SessionManager.php
@@ -293,9 +293,12 @@ class SessionManager
293 return session_start(); 293 return session_start();
294 } 294 }
295 295
296 public function cookieParameters(int $lifeTime, string $path, string $domain): bool 296 /**
297 * Be careful, return type of session_set_cookie_params() changed between PHP 7.1 and 7.2.
298 */
299 public function cookieParameters(int $lifeTime, string $path, string $domain): void
297 { 300 {
298 return session_set_cookie_params($lifeTime, $path, $domain); 301 session_set_cookie_params($lifeTime, $path, $domain);
299 } 302 }
300 303
301 public function regenerateId(bool $deleteOldSession = false): bool 304 public function regenerateId(bool $deleteOldSession = false): bool