From 48df93d5be1c5de89b6e8e0a6bd1866446494f27 Mon Sep 17 00:00:00 2001 From: cyberpower678 Date: Tue, 26 Sep 2023 15:16:33 -0400 Subject: [PATCH] Update pagefunctions.php --- app/src/html/Includes/pagefunctions.php | 28 +++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/app/src/html/Includes/pagefunctions.php b/app/src/html/Includes/pagefunctions.php index a4fb8f1d..718d977a 100644 --- a/app/src/html/Includes/pagefunctions.php +++ b/app/src/html/Includes/pagefunctions.php @@ -2149,19 +2149,21 @@ function loadURLInterface() { MYSQLI_CLIENT_SSL : 0 ) ) ) { - try { - $wikiSQL = "SELECT * FROM page WHERE `page_id` IN (" . implode( ",", $toFetch ) . ");"; - $res = mysqli_query( $db, $wikiSQL ); - } catch (mysqli_sql_exception $e ) { - $res = false; - - $mainHTML->setMessageBox( "warning", "{{{dberror}}}", - "{{{dbqueryerror}}}" - ); - $mainHTML->assignAfterElement( "sqlquery", $wikiSQL ); - $mainHTML->assignAfterElement( "errno", mysqli_errno( $db ) ); - $mainHTML->assignAfterElement( "errormessage", mysqli_error( $db ) ); - } + if( !empty( $toFetch ) ) { + try { + $wikiSQL = "SELECT * FROM page WHERE `page_id` IN (" . implode( ",", $toFetch ) . ");"; + $res = mysqli_query( $db, $wikiSQL ); + } catch( mysqli_sql_exception $e ) { + $res = false; + + $mainHTML->setMessageBox( "warning", "{{{dberror}}}", + "{{{dbqueryerror}}}" + ); + $mainHTML->assignAfterElement( "sqlquery", $wikiSQL ); + $mainHTML->assignAfterElement( "errno", mysqli_errno( $db ) ); + $mainHTML->assignAfterElement( "errormessage", mysqli_error( $db ) ); + } + } else $res = false; if( $res ) { while( $result = $res->fetch_assoc() ) {