]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Allow uppercase letters in PHP sessionid format 336/head
authorArthurHoaro <arthur@hoa.ro>
Wed, 2 Sep 2015 15:00:38 +0000 (17:00 +0200)
committerArthurHoaro <arthur@hoa.ro>
Wed, 2 Sep 2015 15:00:38 +0000 (17:00 +0200)
Fixes shaarli/Shaarli#335 - Wrong login/password since v0.5.2

Regression introduced in 06b6660a7e8891c6e1c47815cf50ee5b2ef5f270

application/Utils.php [changed mode: 0644->0755]
tests/UtilsTest.php [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index fa18f15..cb03f11
@@ -156,7 +156,7 @@ function is_session_id_valid($sessionId)
         return false;
     }
 
         return false;
     }
 
-    if (!preg_match('/^[a-z0-9]{2,32}$/', $sessionId)) {
+    if (!preg_match('/^[a-z0-9]{2,32}$/i', $sessionId)) {
         return false;
     }
 
         return false;
     }
 
old mode 100644 (file)
new mode 100755 (executable)
index e39ce6b..5175dde
@@ -156,7 +156,7 @@ class UtilsTest extends PHPUnit_Framework_TestCase
      */
     public function testIsSessionIdValid()
     {
      */
     public function testIsSessionIdValid()
     {
-        $this->assertTrue(is_session_id_valid('123456789012345678901234567890az'));
+        $this->assertTrue(is_session_id_valid('azertyuiop123456789AZERTYUIOP1aA'));
     }
 
     /**
     }
 
     /**