accessify throw new ErrorException to PHP >= 5.3 only

since 5.2.x (sometimes?) may create strange errors, see http://board.s9y.org/viewtopic.php?f=10&t=19436

I think we don't need to upport this to 2.0, since we will need to bump Serendipity's PHP version to need 5.3 or even up, because of namespaces, security and others soon. PHP 5.2 support has stopped and the PHP 5.3 series has reached end-of-life this summer and will receive only security fixes for the next year.
This commit is contained in:
Ian 2013-07-15 20:11:47 +02:00
parent 34de15298d
commit 694a81a286

View File

@ -112,7 +112,8 @@ if (!function_exists('errorToExceptionHandler')) {
}
//print_r($args); // debugging
// debugbacktrace is nice, but additional it is good to have the verbosity of SPL EXCEPTIONS, except for db connect errors
if (!$serendipity['dbConn']) {
// compare version to not get strange T_NEW parse errors (http://board.s9y.org/viewtopic.php?f=10&t=19436)
if (!$serendipity['dbConn'] || version_compare(PHP_VERSION, '5.3', '<')) {
echo '<p>' . $errStr . ' in ' . $errFile . ' on line ' . $errLine . '</p>';
} else {
throw new ErrorException($errStr); // tracepath = all, if not ini_set('display_errors', 0);
@ -123,8 +124,8 @@ if (!function_exists('errorToExceptionHandler')) {
if ($serendipity['production'] === false) {
echo '<p> == TESTING ERROR MODE == </p>';
echo '<pre>';
// debugbacktrace is nice, but additional it is good to have the verbosity of SPL EXCEPTIONS, except for db connect errors
if (!$serendipity['dbConn']) {
// see notes above
if (!$serendipity['dbConn'] || version_compare(PHP_VERSION, '5.3', '<')) {
echo '<p>' . $errStr . ' in ' . $errFile . ' on line ' . $errLine . '</p>';
} else {
throw new ErrorException($errStr); // tracepath = all, if not ini_set('display_errors', 0);