MDL-81192 sessions: Prevent false positive session change errors
If $CFG->enable_read_only_sessions_debug was not enabled, debugging could be enabled part-way through a request when restart_with_write_lock was called. This meant that a diff between the initial and final session would be made during write_close(), although the intial session state was never captured. This generated false positives in the logs, and it thought any variable set in the session was a change from the original value. This ensures that debugging is enabled before the debug flag is allowed to change, preventing false positives.
This commit is contained in:
@@ -89,7 +89,9 @@ class manager {
|
||||
public static function restart_with_write_lock(bool $readonlysession) {
|
||||
global $CFG;
|
||||
|
||||
self::$requireslockdebug = !$readonlysession;
|
||||
if (!empty($CFG->enable_read_only_sessions_debug)) {
|
||||
self::$requireslockdebug = !$readonlysession;
|
||||
}
|
||||
|
||||
if (self::$sessionactive && !self::$handler->requires_write_lock()) {
|
||||
@self::$handler->abort();
|
||||
|
||||
Reference in New Issue
Block a user