]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fix compatiliby issue on login with PHP 7.1 1614/head
authorArthurHoaro <arthur@hoa.ro>
Wed, 28 Oct 2020 13:02:08 +0000 (14:02 +0100)
committerArthurHoaro <arthur@hoa.ro>
Wed, 28 Oct 2020 13:02:08 +0000 (14:02 +0100)
 session_set_cookie_params does not return any value in PHP 7.1

application/render/PageBuilder.php
application/security/SessionManager.php

index 25e0e284cb3415dcb511794dba8cbc9e276a3d5d..c2fae7052f71116579b136433f7eeb110989db55 100644 (file)
@@ -160,7 +160,7 @@ class PageBuilder
 
         $this->tpl->assign('formatter', $this->conf->get('formatter', 'default'));
 
-        $this->tpl->assign('links_per_page', $this->session['LINKS_PER_PAGE']);
+        $this->tpl->assign('links_per_page', $this->session['LINKS_PER_PAGE'] ?? 20);
 
         // To be removed with a proper theme configuration.
         $this->tpl->assign('conf', $this->conf);
index 36df8c1c9bc823b369f7422a76c63e1f3dd6676b..96bf193c1040debe1e14003c1f3eaab7deba71bf 100644 (file)
@@ -293,9 +293,12 @@ class SessionManager
         return session_start();
     }
 
-    public function cookieParameters(int $lifeTime, string $path, string $domain): bool
+    /**
+     * Be careful, return type of session_set_cookie_params() changed between PHP 7.1 and 7.2.
+     */
+    public function cookieParameters(int $lifeTime, string $path, string $domain): void
     {
-        return session_set_cookie_params($lifeTime, $path, $domain);
+        session_set_cookie_params($lifeTime, $path, $domain);
     }
 
     public function regenerateId(bool $deleteOldSession = false): bool