From 980a0be57f095f76762bf6481d8f2623c12cc985 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 20 Nov 2022 15:47:02 -0500 Subject: [PATCH] [fix] Still cleaning up the PHP 8.1 issues --- src/album.php | 4 ++-- src/folder.php | 4 ++-- src/image.display.php | 3 ++- src/user.php | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/album.php b/src/album.php index b2de109..00caacc 100644 --- a/src/album.php +++ b/src/album.php @@ -22,6 +22,8 @@ include_once "include/common.php"; include_once "include/orderby.php"; include_once "include/site.php"; +$database = site_prolog(); + $album_id = pg_escape_string($database, $_REQUEST['album']); $offset = pg_escape_string($database, isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0); @@ -29,8 +31,6 @@ if ($offset && !is_numeric($offset)) { $offset = 0; } -$database = site_prolog(); - $album = FALSE; if ($album_id && is_numeric($album_id)) { diff --git a/src/folder.php b/src/folder.php index f739791..8ac5c51 100644 --- a/src/folder.php +++ b/src/folder.php @@ -22,6 +22,8 @@ include_once "include/common.php"; include_once "include/site.php"; include_once "include/orderby.php"; +$database = site_prolog(); + $folder_id = pg_escape_string($database, $_REQUEST['folder']); $offset = pg_escape_string($database, isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0); @@ -29,8 +31,6 @@ if ($offset && !is_numeric($offset)) { $offset = 0; } -$database = site_prolog(); - $folder = FALSE; if ($folder_id && is_numeric($folder_id)) { diff --git a/src/image.display.php b/src/image.display.php index 6123fb2..6226353 100644 --- a/src/image.display.php +++ b/src/image.display.php @@ -22,6 +22,8 @@ include_once "include/config.php"; include_once "include/calendar.php"; include_once "include/site.php"; +$database = site_prolog(); + $photo_id = pg_escape_string($database, isset($_REQUEST['image']) ? $_REQUEST['image'] : FALSE); $image_size = pg_escape_string($database, isset($_REQUEST['size']) ? $_REQUEST['size'] : 1); $version = pg_escape_string($database, isset($_REQUEST['ver']) ? $_REQUEST['ver'] : FALSE); @@ -63,7 +65,6 @@ switch ($image_size) { $compress_pages = FALSE; ini_set('zlib.output_compression', 'Off'); -$database = site_prolog(); $cache_ctrl = FALSE; /* Figure out SQL based on image */ diff --git a/src/user.php b/src/user.php index 0f90c0a..9343ace 100644 --- a/src/user.php +++ b/src/user.php @@ -24,10 +24,10 @@ include_once "include/profile.php"; include_once "include/site.php"; include_once "include/orderby.php"; -$owner_id = pg_escape_string($database, isset($_REQUEST['user']) ? $_REQUEST['user'] : 0); - $database = site_prolog(); +$owner_id = pg_escape_string($database, isset($_REQUEST['user']) ? $_REQUEST['user'] : 0); + $tmp = FALSE; if ($owner_id) {