Allow uppercase letters in PHP sessionid format

Fixes shaarli/Shaarli#335 - Wrong login/password since v0.5.2

Regression introduced in 06b6660a7e
This commit is contained in:
ArthurHoaro 2015-09-02 17:00:38 +02:00
parent 53cc2b93b8
commit 4d30975a06
2 changed files with 2 additions and 2 deletions

2
application/Utils.php Normal file → Executable file
View file

@ -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;
} }

2
tests/UtilsTest.php Normal file → Executable file
View file

@ -156,7 +156,7 @@ public function testCheckSupportedPHPVersion52()
*/ */
public function testIsSessionIdValid() public function testIsSessionIdValid()
{ {
$this->assertTrue(is_session_id_valid('123456789012345678901234567890az')); $this->assertTrue(is_session_id_valid('azertyuiop123456789AZERTYUIOP1aA'));
} }
/** /**