From 4d30975a06354c5a01d2dfdfc5441e160ef4073e Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Wed, 2 Sep 2015 17:00:38 +0200 Subject: [PATCH] Allow uppercase letters in PHP sessionid format Fixes shaarli/Shaarli#335 - Wrong login/password since v0.5.2 Regression introduced in 06b6660a7e8891c6e1c47815cf50ee5b2ef5f270 --- application/Utils.php | 2 +- tests/UtilsTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 application/Utils.php mode change 100644 => 100755 tests/UtilsTest.php diff --git a/application/Utils.php b/application/Utils.php old mode 100644 new mode 100755 index fa18f1588..cb03f11c7 --- 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 e39ce6be0..5175dde03 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -156,7 +156,7 @@ public function testCheckSupportedPHPVersion52() */ public function testIsSessionIdValid() { - $this->assertTrue(is_session_id_valid('123456789012345678901234567890az')); + $this->assertTrue(is_session_id_valid('azertyuiop123456789AZERTYUIOP1aA')); } /**