From 8c4ca7c8ef4f2cb5ad96ce6a7435dad33257bbcf Mon Sep 17 00:00:00 2001 From: wn Date: Sat, 12 Dec 2020 10:09:25 -0600 Subject: Fix some 'isset' checks in 'classes/pref/prefs.php'. --- classes/pref/prefs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes/pref') 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 ""; -- cgit v1.2.3 From a1f8d6941ba4b0499f6a1177a8f451aa436d2bb5 Mon Sep 17 00:00:00 2001 From: wn Date: Sat, 12 Dec 2020 10:14:40 -0600 Subject: Remove duplicate block in 'classes/pref/filters.php'. Also a minor tweak to getting the search filter. --- classes/pref/filters.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'classes/pref') diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 00644c59f..70b7d0326 100755 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -736,10 +736,8 @@ class Pref_Filters extends Handler_Protected { } function index() { - - $filter_search = clean($_REQUEST["search"]); - if (array_key_exists("search", $_REQUEST)) { + $filter_search = clean($_REQUEST["search"]); $_SESSION["prefs_filter_search"] = $filter_search; } else { $filter_search = $_SESSION["prefs_filter_search"]; @@ -749,12 +747,6 @@ class Pref_Filters extends Handler_Protected { print "
"; print "
"; - if (array_key_exists("search", $_REQUEST)) { - $_SESSION["prefs_filter_search"] = $filter_search; - } else { - $filter_search = $_SESSION["prefs_filter_search"]; - } - print "
-- cgit v1.2.3 From 62da307ef147b32eb214edecf1541f8ce896a700 Mon Sep 17 00:00:00 2001 From: wn Date: Sat, 12 Dec 2020 10:18:50 -0600 Subject: Use correct 'sprintf' function and other minor fixes in Pref_Feeds. --- classes/pref/feeds.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'classes/pref') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index ca2c7b514..b19d161fd 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -126,6 +126,7 @@ class Pref_Feeds extends Handler_Protected { $root['id'] = 'root'; $root['name'] = __('Feeds'); $root['items'] = array(); + $root['param'] = 0; $root['type'] = 'category'; $enable_cats = get_pref('ENABLE_FEED_CATS'); @@ -229,7 +230,7 @@ class Pref_Feeds extends Handler_Protected { $cat['items'] = $this->get_category_items($line['id']); $num_children = $this->calculate_children_count($cat); - $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children); + $cat['param'] = sprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children); if ($num_children > 0 || $show_empty_cats) array_push($root['items'], $cat); @@ -277,13 +278,13 @@ class Pref_Feeds extends Handler_Protected { array_push($cat['items'], $feed); } - $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', count($cat['items'])), count($cat['items'])); + $cat['param'] = sprintf(_ngettext('(%d feed)', '(%d feeds)', count($cat['items'])), count($cat['items'])); if (count($cat['items']) > 0 || $show_empty_cats) array_push($root['items'], $cat); $num_children = $this->calculate_children_count($root); - $root['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children); + $root['param'] = sprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children); } else { $fsth = $this->pdo->prepare("SELECT id, title, last_error, @@ -312,7 +313,7 @@ class Pref_Feeds extends Handler_Protected { array_push($root['items'], $feed); } - $root['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', count($root['items'])), count($root['items'])); + $root['param'] = sprintf(_ngettext('(%d feed)', '(%d feeds)', count($root['items'])), count($root['items'])); } $fl = array(); @@ -1198,10 +1199,11 @@ class Pref_Feeds extends Handler_Protected { } if ($num_errors > 0) { - $error_button = ""; + } else { + $error_button = ""; } $inactive_button = "