Skip to content
Snippets Groups Projects
Commit 84371887 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

No need to disable the error handler momentarily when guessing the timezone...

No need to disable the error handler momentarily when guessing the timezone from the OS. Mask errors instead.
parent 76588321
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
namespace SimpleSAML\Utils; namespace SimpleSAML\Utils;
use SimpleSAML\Logger;
class Time class Time
{ {
...@@ -56,17 +58,9 @@ class Time ...@@ -56,17 +58,9 @@ class Time
} }
// we don't have a timezone configured // we don't have a timezone configured
/* Logger::maskErrors(E_ALL);
* The date_default_timezone_get() function is likely to cause a warning.
* Since we have a custom error handler which logs the errors with a backtrace,
* this error will be logged even if we prefix the function call with '@'.
* Instead we temporarily replace the error handler.
*/
set_error_handler(function () {
return true;
});
$serverTimezone = date_default_timezone_get(); $serverTimezone = date_default_timezone_get();
restore_error_handler(); Logger::popErrorMask();
// set the timezone to the default // set the timezone to the default
date_default_timezone_set($serverTimezone); date_default_timezone_set($serverTimezone);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment