summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorwn <[email protected]>2020-12-12 09:56:10 -0600
committerwn <[email protected]>2020-12-12 10:28:52 -0600
commitc68f2aabc929221b6c5af5ff51d28b990f6cd0f1 (patch)
treee76d8cbeb364f35a87357881b4af1244298030ce /include
parent936b91a7e656169c7cc2f4652ee4ab9114d11dbc (diff)
Make 'ttrss_error_handler' compatible w/ 8.
https://github.com/php/php-src/blob/2d467abc46ec4ee97484d4e35909bed322600037/UPGRADING#L43 https://github.com/php/php-src/blob/2d467abc46ec4ee97484d4e35909bed322600037/UPGRADING#L63
Diffstat (limited to 'include')
-rw-r--r--include/errorhandler.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/errorhandler.php b/include/errorhandler.php
index 95c9edc69..188c8c5ce 100644
--- a/include/errorhandler.php
+++ b/include/errorhandler.php
@@ -31,7 +31,13 @@ function format_backtrace($trace) {
return $rv;
}
-function ttrss_error_handler($errno, $errstr, $file, $line, $context) {
+function ttrss_error_handler($errno, $errstr, $file, $line) {
+ if (version_compare(PHP_VERSION, '8.0.0', '<')) {
+ if (error_reporting() == 0 || !$errno) return false;
+ } else {
+ if (!(error_reporting() & $errno)) return false;
+ }
+
if (error_reporting() == 0 || !$errno) return false;
$file = substr(str_replace(dirname(dirname(__FILE__)), "", $file), 1);