From a1a352f5c8f0579cdc3d18c9707ea0998aa09dd7 Mon Sep 17 00:00:00 2001 From: Banana Date: Sat, 17 Dec 2022 17:22:24 +0100 Subject: [PATCH] removed some php8 warnings --- webclient/api.php | 9 ++------- webclient/index.php | 2 -- .../view/default/advancedsearch/advancedsearch.php | 4 ++-- webclient/view/default/bulkedit/bulkedit.php | 4 ++-- webclient/view/default/dashboard/dashboard.php | 4 ++-- webclient/view/default/entry/entry.php | 8 ++++---- .../managecollectionfields.php | 4 ++-- .../default/managecolletions/managecolletions.php | 4 ++-- webclient/view/default/manageentry/manageentry.php | 8 ++++---- webclient/view/default/managegroups/managegroups.php | 6 +++--- webclient/view/default/managetags/managetags.php | 8 ++++---- webclient/view/default/manageusers/manageusers.php | 6 +++--- webclient/view/default/sysinfo/sysinfo.html | 2 ++ webclient/view/default/tool/tool.php | 12 ++++++------ 14 files changed, 38 insertions(+), 43 deletions(-) diff --git a/webclient/api.php b/webclient/api.php index f39ef22..7e4ab49 100644 --- a/webclient/api.php +++ b/webclient/api.php @@ -53,11 +53,6 @@ require_once 'lib/mancubus.class.php'; require_once 'lib/manageentry.class.php'; require_once 'lib/trite.class.php'; -## main vars -# database object -$DB = false; -$Spectre = false; - ## DB connection $DB = new mysqli(DB_HOST, DB_USERNAME,DB_PASSWORD, DB_NAME); $driver = new mysqli_driver(); @@ -78,10 +73,10 @@ if(isset($_GET['p']) && !empty($_GET['p'])) { if(!$Spectre->allowedRequests($_requestMode)) $_requestMode = "default"; } -$_authKey = false; +$_authKey = ''; if(isset($_GET['authKey']) && !empty($_GET['authKey'])) { $_authKey = trim($_GET['authKey']); - $_authKey = Summoner::validate($_authKey,'nospace') ? $_authKey : false; + $_authKey = Summoner::validate($_authKey,'nospace') ? $_authKey : ''; } $_apiResult = array( diff --git a/webclient/index.php b/webclient/index.php index 04e1109..3c2423a 100644 --- a/webclient/index.php +++ b/webclient/index.php @@ -53,8 +53,6 @@ require_once 'lib/gorenest.class.php'; ## main vars -# database object -$DB = false; # the template data as an array # and some defaults $TemplateData = array(); diff --git a/webclient/view/default/advancedsearch/advancedsearch.php b/webclient/view/default/advancedsearch/advancedsearch.php index 45ea518..3625431 100644 --- a/webclient/view/default/advancedsearch/advancedsearch.php +++ b/webclient/view/default/advancedsearch/advancedsearch.php @@ -21,10 +21,10 @@ $Trite = new Trite($DB,$Doomguy); require_once 'lib/mancubus.class.php'; $Mancubus = new Mancubus($DB,$Doomguy); -$_collection = false; +$_collection = ''; if(isset($_GET['collection']) && !empty($_GET['collection'])) { $_collection = trim($_GET['collection']); - $_collection = Summoner::validate($_collection,'digit') ? $_collection : false; + $_collection = Summoner::validate($_collection,'digit') ? $_collection : ''; } $TemplateData['pageTitle'] = 'Advanced search'; diff --git a/webclient/view/default/bulkedit/bulkedit.php b/webclient/view/default/bulkedit/bulkedit.php index 73f7880..eb7d222 100644 --- a/webclient/view/default/bulkedit/bulkedit.php +++ b/webclient/view/default/bulkedit/bulkedit.php @@ -21,10 +21,10 @@ $Trite = new Trite($DB,$Doomguy); require_once 'lib/manageentry.class.php'; $ManageEntry = new Manageentry($DB,$Doomguy); -$_collection = false; +$_collection = ''; if(isset($_GET['collection']) && !empty($_GET['collection'])) { $_collection = trim($_GET['collection']); - $_collection = Summoner::validate($_collection,'digit') ? $_collection : false; + $_collection = Summoner::validate($_collection,'digit') ? $_collection : ''; } $TemplateData['loadedCollection'] = array(); diff --git a/webclient/view/default/dashboard/dashboard.php b/webclient/view/default/dashboard/dashboard.php index 098daa5..cff4d5b 100644 --- a/webclient/view/default/dashboard/dashboard.php +++ b/webclient/view/default/dashboard/dashboard.php @@ -22,10 +22,10 @@ $Mancubus = new Mancubus($DB,$Doomguy); $TemplateData['search'] = false; $TemplateData['searchAction'] = 'index.php'; -$_search = false; +$_search = ''; if(isset($_POST['navSearch'])) { $_search = trim($_POST['navSearch']); - $_search = Summoner::validate($_search,'text') ? $_search : false; + $_search = Summoner::validate($_search,'text') ? $_search : ''; } $TemplateData['latest'] = $Mancubus->getLatest(5,5,$_search); diff --git a/webclient/view/default/entry/entry.php b/webclient/view/default/entry/entry.php index f6e7752..89e180d 100644 --- a/webclient/view/default/entry/entry.php +++ b/webclient/view/default/entry/entry.php @@ -23,16 +23,16 @@ $ManageEntry = new Manageentry($DB,$Doomguy); require_once 'lib/trite.class.php'; $Trite = new Trite($DB,$Doomguy); -$_collection = false; +$_collection = ''; if(isset($_GET['collection']) && !empty($_GET['collection'])) { $_collection = trim($_GET['collection']); - $_collection = Summoner::validate($_collection,'digit') ? $_collection : false; + $_collection = Summoner::validate($_collection,'digit') ? $_collection : ''; } -$_id = false; +$_id = ''; if(isset($_GET['id']) && !empty($_GET['id'])) { $_id = trim($_GET['id']); - $_id = Summoner::validate($_id,'digit') ? $_id : false; + $_id = Summoner::validate($_id,'digit') ? $_id : ''; } $TemplateData['pageTitle'] = '?'; diff --git a/webclient/view/default/managecollectionfields/managecollectionfields.php b/webclient/view/default/managecollectionfields/managecollectionfields.php index 8ef8125..b8f08b7 100644 --- a/webclient/view/default/managecollectionfields/managecollectionfields.php +++ b/webclient/view/default/managecollectionfields/managecollectionfields.php @@ -29,10 +29,10 @@ $TemplateData['existingFields'] = array(); $TemplateData['pageTitle'] = 'Manage collection fields'; -$_id = false; +$_id = ''; if(isset($_GET['id']) && !empty($_GET['id'])) { $_id = trim($_GET['id']); - $_id = Summoner::validate($_id,'digit') ? $_id : false; + $_id = Summoner::validate($_id,'digit') ? $_id : ''; } if(!empty($_id)) { diff --git a/webclient/view/default/managecolletions/managecolletions.php b/webclient/view/default/managecolletions/managecolletions.php index 58864e1..6f0c4c4 100644 --- a/webclient/view/default/managecolletions/managecolletions.php +++ b/webclient/view/default/managecolletions/managecolletions.php @@ -42,10 +42,10 @@ if(isset($_GET['m']) && !empty($_GET['m'])) { } } -$_id = false; +$_id =''; if(isset($_GET['id']) && !empty($_GET['id'])) { $_id = trim($_GET['id']); - $_id = Summoner::validate($_id,'digit') ? $_id : false; + $_id = Summoner::validate($_id,'digit') ? $_id : ''; } if($_editMode === true && !empty($_id)) { diff --git a/webclient/view/default/manageentry/manageentry.php b/webclient/view/default/manageentry/manageentry.php index b6fe15d..b5bf291 100644 --- a/webclient/view/default/manageentry/manageentry.php +++ b/webclient/view/default/manageentry/manageentry.php @@ -30,16 +30,16 @@ $TemplateData['existingCollections'] = array(); $TemplateData['_editFieldViewDefault'] = Summoner::themefile('manageentry/field-unknown.html', UI_THEME); -$_collection = false; +$_collection = ''; if(isset($_GET['collection']) && !empty($_GET['collection'])) { $_collection = trim($_GET['collection']); - $_collection = Summoner::validate($_collection,'digit') ? $_collection : false; + $_collection = Summoner::validate($_collection,'digit') ? $_collection : ''; } -$_id = false; +$_id = ''; if(isset($_GET['id']) && !empty($_GET['id'])) { $_id = trim($_GET['id']); - $_id = Summoner::validate($_id,'digit') ? $_id : false; + $_id = Summoner::validate($_id,'digit') ? $_id : ''; } if(!empty($_collection)) { diff --git a/webclient/view/default/managegroups/managegroups.php b/webclient/view/default/managegroups/managegroups.php index 2936ffb..9ba3e7a 100644 --- a/webclient/view/default/managegroups/managegroups.php +++ b/webclient/view/default/managegroups/managegroups.php @@ -18,14 +18,14 @@ require_once 'lib/possessed.class.php'; $Possessed = new Possessed($DB, $Doomguy); $TemplateData['existingGroups'] = $Possessed->getGroups(); -$TemplateData['editData'] = false; +$TemplateData['editData'] = array(); $TemplateData['pageTitle'] = 'Manage groups'; -$_id = false; +$_id = ''; if(isset($_GET['id']) && !empty($_GET['id'])) { $_id = trim($_GET['id']); - $_id = Summoner::validate($_id,'digit') ? $_id : false; + $_id = Summoner::validate($_id,'digit') ? $_id : ''; } if(!empty($_id)) { diff --git a/webclient/view/default/managetags/managetags.php b/webclient/view/default/managetags/managetags.php index 329b57d..a2841c3 100644 --- a/webclient/view/default/managetags/managetags.php +++ b/webclient/view/default/managetags/managetags.php @@ -21,16 +21,16 @@ $Trite = new Trite($DB,$Doomguy); require_once 'lib/managetags.class.php'; $ManageTags = new ManageTags($DB,$Doomguy); -$_collection = false; +$_collection = ''; if(isset($_GET['collection']) && !empty($_GET['collection'])) { $_collection = trim($_GET['collection']); - $_collection = Summoner::validate($_collection,'digit') ? $_collection : false; + $_collection = Summoner::validate($_collection,'digit') ? $_collection : ''; } -$_id = false; +$_id = ''; if(isset($_GET['id']) && !empty($_GET['id'])) { $_id = trim($_GET['id']); - $_id = Summoner::validate($_id,'digit') ? $_id : false; + $_id = Summoner::validate($_id,'digit') ? $_id : ''; } $TemplateData['loadedCollection'] = array(); diff --git a/webclient/view/default/manageusers/manageusers.php b/webclient/view/default/manageusers/manageusers.php index 7c431ff..3fadd6d 100644 --- a/webclient/view/default/manageusers/manageusers.php +++ b/webclient/view/default/manageusers/manageusers.php @@ -19,14 +19,14 @@ require_once 'lib/possessed.class.php'; $Possessed = new Possessed($DB, $Doomguy); $TemplateData['existingGroups'] = $Possessed->getGroups(); $TemplateData['existingUsers'] = $Possessed->getUsers(); -$TemplateData['editData'] = false; +$TemplateData['editData'] = array(); $TemplateData['editData']['groups'] = array(); $TemplateData['pageTitle'] = 'Manage users'; -$_id = false; +$_id = ''; if(isset($_GET['id']) && !empty($_GET['id'])) { $_id = trim($_GET['id']); - $_id = Summoner::validate($_id,'digit') ? $_id : false; + $_id = Summoner::validate($_id,'digit') ? $_id : ''; } if(!empty($_id)) { diff --git a/webclient/view/default/sysinfo/sysinfo.html b/webclient/view/default/sysinfo/sysinfo.html index 873b338..7612fc5 100644 --- a/webclient/view/default/sysinfo/sysinfo.html +++ b/webclient/view/default/sysinfo/sysinfo.html @@ -19,6 +19,8 @@ + +
  • Bibliotheca:
  • diff --git a/webclient/view/default/tool/tool.php b/webclient/view/default/tool/tool.php index cb568f5..96d5958 100644 --- a/webclient/view/default/tool/tool.php +++ b/webclient/view/default/tool/tool.php @@ -31,22 +31,22 @@ $TemplateData['tool']['viewFile'] = ''; $TemplateData['collection'] = array(); $TemplateData['editEntry'] = array(); -$_collection = false; +$_collection = ''; if(isset($_GET['collection']) && !empty($_GET['collection'])) { $_collection = trim($_GET['collection']); - $_collection = Summoner::validate($_collection,'digit') ? $_collection : false; + $_collection = Summoner::validate($_collection,'digit') ? $_collection : ''; } -$_id = false; +$_id = ''; if(isset($_GET['id']) && !empty($_GET['id'])) { $_id = trim($_GET['id']); - $_id = Summoner::validate($_id,'digit') ? $_id : false; + $_id = Summoner::validate($_id,'digit') ? $_id : ''; } -$_t = false; +$_t = ''; if(isset($_GET['t']) && !empty($_GET['t'])) { $_t = trim($_GET['t']); - $_t = Summoner::validate($_t,'nospace') ? $_t : false; + $_t = Summoner::validate($_t,'nospace') ? $_t : ''; } if(!empty($_collection) && !empty($_t)) { -- 2.39.5