diff options
author | Jaime Perez Crespo <jaime.perez@uninett.no> | 2016-03-04 14:23:48 +0100 |
---|---|---|
committer | Jaime Perez Crespo <jaime.perez@uninett.no> | 2016-03-04 14:23:48 +0100 |
commit | 84371887a91c28bc1d394df2a80a8770a136d716 (patch) | |
tree | e1244df02807c89a6306dea6c640b36ea49ebc25 /lib/SimpleSAML | |
parent | 7658832143f12be180c4a5b62fdea919e8ec4d25 (diff) | |
download | simplesamlphp-84371887a91c28bc1d394df2a80a8770a136d716.zip simplesamlphp-84371887a91c28bc1d394df2a80a8770a136d716.tar.gz simplesamlphp-84371887a91c28bc1d394df2a80a8770a136d716.tar.bz2 |
No need to disable the error handler momentarily when guessing the timezone from the OS. Mask errors instead.
Diffstat (limited to 'lib/SimpleSAML')
-rw-r--r-- | lib/SimpleSAML/Utils/Time.php | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/SimpleSAML/Utils/Time.php b/lib/SimpleSAML/Utils/Time.php index bbbcb8c..66d8a4e 100644 --- a/lib/SimpleSAML/Utils/Time.php +++ b/lib/SimpleSAML/Utils/Time.php @@ -7,6 +7,8 @@ namespace SimpleSAML\Utils; +use SimpleSAML\Logger; + class Time { @@ -56,17 +58,9 @@ class Time } // we don't have a timezone configured - /* - * 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; - }); + Logger::maskErrors(E_ALL); $serverTimezone = date_default_timezone_get(); - restore_error_handler(); + Logger::popErrorMask(); // set the timezone to the default date_default_timezone_set($serverTimezone); |