From 2d2fec03eaef86571149671ce30d7de7bba76373 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 20 Nov 2022 16:38:01 -0500 Subject: [PATCH] [fix] More PHP8.1 --- src/search.folder.php | 4 ++-- src/search.tags.php | 3 ++- src/search.text.advanced.php | 3 ++- src/search.text.general.php | 4 ++-- src/search.users.php | 3 ++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/search.folder.php b/src/search.folder.php index 30b1fef..84d72ee 100644 --- a/src/search.folder.php +++ b/src/search.folder.php @@ -72,12 +72,12 @@ if (!$current_user_id || ($current_user_id=="all")) { $sql_album_users_string = " and album.users = $current_user_id "; } +$database = site_prolog(); + $offset = pg_escape_string($database, isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0); $order_by = $po_options['order_by']; -$database = site_prolog(); - site_header($strings['generic_search']); site_navigator(2); diff --git a/src/search.tags.php b/src/search.tags.php index dfade17..f81bf04 100644 --- a/src/search.tags.php +++ b/src/search.tags.php @@ -27,6 +27,8 @@ include_once "include/search.php"; $search_data = isset($_REQUEST['keyword']) ? validate_search_string($_REQUEST['keyword']) : ""; $master = isset($_REQUEST['only_masters']); +$database = site_prolog(); + $offset = pg_escape_string($database, isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0); if ($offset && !is_numeric($offset)) { $offset = 0; @@ -36,7 +38,6 @@ $arguments = array(); $order_by = $po_options['order_by']; -$database = site_prolog(); $keywords = extract_keywords($search_data, $po_options['search_enable_stemming']); diff --git a/src/search.text.advanced.php b/src/search.text.advanced.php index dae6cbb..261667c 100644 --- a/src/search.text.advanced.php +++ b/src/search.text.advanced.php @@ -120,6 +120,8 @@ if ($search_data['end_date'] == 'null') $search_data['end_date'] = ''; $master = isset($_REQUEST['only_masters']); +$database = site_prolog(); + $offset = pg_escape_string($database, isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0); if ($offset && !is_numeric($offset)) { $offset = 0; @@ -127,7 +129,6 @@ if ($offset && !is_numeric($offset)) { $order_by = $po_options['order_by']; -$database = site_prolog(); site_header($strings['generic_search']); site_navigator(2); diff --git a/src/search.text.general.php b/src/search.text.general.php index b5acd4c..4700a67 100644 --- a/src/search.text.general.php +++ b/src/search.text.general.php @@ -75,6 +75,8 @@ if (!$current_user_id || ($current_user_id=="all")) { $sql_album_users_string = " and album.users = $current_user_id "; } +$database = site_prolog(); + $offset = pg_escape_string($database, isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0); if ($offset && !is_numeric($offset)) { $offset = 0; @@ -82,8 +84,6 @@ if ($offset && !is_numeric($offset)) { $order_by = $po_options['order_by']; -$database = site_prolog(); - site_header($strings['generic_search']); site_navigator(2); diff --git a/src/search.users.php b/src/search.users.php index d9db36f..c4686fb 100644 --- a/src/search.users.php +++ b/src/search.users.php @@ -75,13 +75,14 @@ $current_user_id = isset($_REQUEST['current_user']) ? $_REQUEST['current_user'] if ($current_user_id == 'null') $current_user_id = $po_user['id']; +$database = site_prolog(); + $master = isset($_REQUEST['only_masters']); $offset = pg_escape_string($database, isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0); $order_by = $po_options['order_by']; -$database = site_prolog(); site_header($strings['generic_search']);