X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FUtils.php;h=1422961d4a9acb522bf74d87ae848c77ae157cad;hb=b11c8f25dfe3c684f2f39352e3acdeb660a069ac;hp=fa18f1588b278352554dbf85312980f4be6289e8;hpb=6211c498f6e0bdc6d86152e9777bcc75955a5ec4;p=github%2Fshaarli%2FShaarli.git diff --git a/application/Utils.php b/application/Utils.php old mode 100644 new mode 100755 index fa18f158..1422961d --- a/application/Utils.php +++ b/application/Utils.php @@ -140,11 +140,16 @@ function checkPHPVersion($minVersion, $curVersion) /** * Validate session ID to prevent Full Path Disclosure. + * * See #298. + * The session ID's format depends on the hash algorithm set in PHP settings * * @param string $sessionId Session ID * * @return true if valid, false otherwise. + * + * @see http://php.net/manual/en/function.hash-algos.php + * @see http://php.net/manual/en/session.configuration.php */ function is_session_id_valid($sessionId) { @@ -156,7 +161,7 @@ function is_session_id_valid($sessionId) return false; } - if (!preg_match('/^[a-z0-9]{2,32}$/', $sessionId)) { + if (!preg_match('/^[a-zA-Z0-9,-]{2,128}$/', $sessionId)) { return false; }