diff --git a/extlib/simplesamlphp/lib/SimpleSAML/Logger.php b/extlib/simplesamlphp/lib/SimpleSAML/Logger.php index 618c6b7b5..57e7ada07 100644 --- a/extlib/simplesamlphp/lib/SimpleSAML/Logger.php +++ b/extlib/simplesamlphp/lib/SimpleSAML/Logger.php @@ -341,6 +341,7 @@ private static function defer($level, $message, $stats) // save the message for later self::$earlyLog[] = array('level' => $level, 'string' => $message, 'statsLog' => $stats); + // register a shutdown handler if needed if (!self::$shutdownRegistered) { register_shutdown_function(array('SimpleSAML\Logger', 'flush')); diff --git a/extlib/simplesamlphp/lib/SimpleSAML/Session.php b/extlib/simplesamlphp/lib/SimpleSAML/Session.php index ccc7ccc59..3b8cbbf87 100644 --- a/extlib/simplesamlphp/lib/SimpleSAML/Session.php +++ b/extlib/simplesamlphp/lib/SimpleSAML/Session.php @@ -490,6 +490,10 @@ public function markDirty() $this->dirty = true; + // Moodle auth_saml2 hack, because we register a shutdown handler in + // moodle in the constructor we don't need to register a callback here. + return; + if (!function_exists('header_register_callback')) { // PHP version < 5.4, can't register the callback return; @@ -511,7 +515,9 @@ public function markDirty() */ public function __destruct() { - $this->save(); + // Moodle auth_saml2 hack, we don't need to save here because we have + // a custom shutdown handle registered with moodle. + // $this->save(); } /**