From: ArthurHoaro Date: Wed, 2 Sep 2015 15:00:38 +0000 (+0200) Subject: Allow uppercase letters in PHP sessionid format X-Git-Tag: 0.5.3^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=4d30975a06354c5a01d2dfdfc5441e160ef4073e;p=github%2Fshaarli%2FShaarli.git Allow uppercase letters in PHP sessionid format Fixes shaarli/Shaarli#335 - Wrong login/password since v0.5.2 Regression introduced in 06b6660a7e8891c6e1c47815cf50ee5b2ef5f270 --- diff --git a/application/Utils.php b/application/Utils.php old mode 100644 new mode 100755 index fa18f158..cb03f11c --- a/application/Utils.php +++ b/application/Utils.php @@ -156,7 +156,7 @@ function is_session_id_valid($sessionId) return false; } - if (!preg_match('/^[a-z0-9]{2,32}$/', $sessionId)) { + if (!preg_match('/^[a-z0-9]{2,32}$/i', $sessionId)) { return false; } diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php old mode 100644 new mode 100755 index e39ce6be..5175dde0 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -156,7 +156,7 @@ class UtilsTest extends PHPUnit_Framework_TestCase */ public function testIsSessionIdValid() { - $this->assertTrue(is_session_id_valid('123456789012345678901234567890az')); + $this->assertTrue(is_session_id_valid('azertyuiop123456789AZERTYUIOP1aA')); } /**