";
- if (array_key_exists("search", $_REQUEST)) {
- $_SESSION["prefs_filter_search"] = $filter_search;
- } else {
- $filter_search = $_SESSION["prefs_filter_search"];
- }
-
print "
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index d7b486cbb..4e57ea846 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -1271,14 +1271,14 @@ class Pref_Prefs extends Handler_Protected {
}
private function getShortDesc($pref_name) {
- if (isset($this->pref_help[$pref_name])) {
+ if (isset($this->pref_help[$pref_name][0])) {
return $this->pref_help[$pref_name][0];
}
return "";
}
private function getHelpText($pref_name) {
- if (isset($this->pref_help[$pref_name])) {
+ if (isset($this->pref_help[$pref_name][1])) {
return $this->pref_help[$pref_name][1];
}
return "";
diff --git a/classes/urlhelper.php b/classes/urlhelper.php
index cc1074c55..fec36de51 100644
--- a/classes/urlhelper.php
+++ b/classes/urlhelper.php
@@ -1,8 +1,9 @@
$error) {
+ foreach (get_error_types() as $id => $error) {
$error = preg_replace("/\n/", "", $error);
$error = preg_replace("/\"/", "\\\"", $error);
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);
diff --git a/include/functions.php b/include/functions.php
index ceb7fbd9e..a70b4ac44 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -18,7 +18,10 @@
$fetch_effective_url = false;
$fetch_curl_used = false;
- libxml_disable_entity_loader(true);
+ if (version_compare(PHP_VERSION, '8.0.0', '<')) {
+ libxml_disable_entity_loader(true);
+ }
+
libxml_use_internal_errors(true);
// separate test because this is included before sanity checks
@@ -327,7 +330,7 @@
function sanity_check() {
require_once 'errors.php';
- global $ERRORS;
+ $ERRORS = get_error_types();
$error_code = 0;
$schema_version = get_schema_version(true);
@@ -540,7 +543,7 @@
*/
function error_json($code) {
require_once "errors.php";
- global $ERRORS;
+ $ERRORS = get_error_types();
@$message = $ERRORS[$code];
diff --git a/include/sanity_check.php b/include/sanity_check.php
index 86dc7a5f0..e6c0e5d4b 100755
--- a/include/sanity_check.php
+++ b/include/sanity_check.php
@@ -21,6 +21,8 @@
}
function make_self_url_path() {
+ if (!isset($_SERVER["HTTP_HOST"])) return false;
+
$proto = is_server_https() ? 'https' : 'http';
$url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
@@ -115,14 +117,18 @@
}
$ref_self_url_path = make_self_url_path();
- $ref_self_url_path = preg_replace("/\w+\.php$/", "", $ref_self_url_path);
- if (SELF_URL_PATH == "http://example.org/tt-rss/") {
- array_push($errors,
- "Please set SELF_URL_PATH to the correct value for your server (possible value: $ref_self_url_path)");
+ if ($ref_self_url_path) {
+ $ref_self_url_path = preg_replace("/\w+\.php$/", "", $ref_self_url_path);
}
- if (isset($_SERVER["HTTP_HOST"]) &&
+ if (SELF_URL_PATH == "http://example.org/tt-rss/") {
+ $hint = $ref_self_url_path ? "(possible value: $ref_self_url_path)" : "";
+ array_push($errors,
+ "Please set SELF_URL_PATH to the correct value for your server $hint");
+ }
+
+ if ($ref_self_url_path &&
(!defined('_SKIP_SELF_URL_PATH_CHECKS') || !_SKIP_SELF_URL_PATH_CHECKS) &&
SELF_URL_PATH != $ref_self_url_path && SELF_URL_PATH != mb_substr($ref_self_url_path, 0, mb_strlen($ref_self_url_path)-1)) {
array_push($errors,
diff --git a/lib/gettext/gettext.inc.php b/lib/gettext/gettext.inc.php
index ed5be6bbd..ef36924c7 100644
--- a/lib/gettext/gettext.inc.php
+++ b/lib/gettext/gettext.inc.php
@@ -167,7 +167,7 @@ function _check_locale_and_function($function=false) {
function _get_codeset($domain=null) {
global $text_domains, $default_domain, $LC_CATEGORIES;
if (!isset($domain)) $domain = $default_domain;
- return (isset($text_domains[$domain]->codeset))? $text_domains[$domain]->codeset : ini_get('mbstring.internal_encoding');
+ return (isset($text_domains[$domain]->codeset))? $text_domains[$domain]->codeset : ini_get('default_charset');
}
/**
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php
index d3e91f383..7a395801d 100755
--- a/plugins/af_redditimgur/init.php
+++ b/plugins/af_redditimgur/init.php
@@ -506,7 +506,7 @@ class Af_RedditImgur extends Plugin {
}
}
- private function get_header($url, $useragent = SELF_USER_AGENT, $header) {
+ private function get_header($url, $header, $useragent = SELF_USER_AGENT) {
$ret = false;
if (function_exists("curl_init") && !defined("NO_CURL")) {
@@ -526,11 +526,11 @@ class Af_RedditImgur extends Plugin {
}
private function get_content_type($url, $useragent = SELF_USER_AGENT) {
- return $this->get_header($url, $useragent, CURLINFO_CONTENT_TYPE);
+ return $this->get_header($url, CURLINFO_CONTENT_TYPE, $useragent);
}
private function get_location($url, $useragent = SELF_USER_AGENT) {
- return $this->get_header($url, $useragent, CURLINFO_EFFECTIVE_URL);
+ return $this->get_header($url, CURLINFO_EFFECTIVE_URL, $useragent);
}
/**
diff --git a/update.php b/update.php
index 95f19d022..d60b1a6a5 100755
--- a/update.php
+++ b/update.php
@@ -239,7 +239,7 @@
RSSUtils::update_daemon_common(DAEMON_FEED_LIMIT, $options);
RSSUtils::housekeeping_common();
- PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op);
+ PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $options);
}
if (isset($options["daemon"])) {