Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c646c8c

Browse files
committed
security: Ensure Session ID
This ensures the session ID is of an acceptable format before sending to `create()`.
1 parent 3ff35ad commit c646c8c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/class.ostsession.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ public static function lookupRecord($id, $autocreate = false,
422422
}
423423
catch (DoesNotExist $e) {
424424
// We're auto-creating model (unsaved) when one doesn't exist?
425-
$record = $autocreate ? self::create($id) : null;
425+
$record = ($autocreate && ctype_alnum($id)) ? self::create($id) : null;
426426
}
427427
catch (OrmException | Exception $ex) {
428428
// This could happen if more than one record exits in the

0 commit comments

Comments
 (0)