Skip to content

Commit

Permalink
3.0.0.22
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
nilsteampassnet committed Feb 11, 2023
1 parent d5bf889 commit 6d6cfcb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions api/Controller/Api/ItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ public function getAction(array $userData): void
{
$superGlobal = new protect\SuperGlobal\SuperGlobal();
$strErrorDesc = '';
$sqlExtra = '';
$responseData = '';
$strErrorHeader = '';
$requestMethod = $superGlobal->get('REQUEST_METHOD', 'SERVER');

// get parameters
Expand Down
15 changes: 7 additions & 8 deletions install/tp.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ function addNewSetting($table, $type, $label, $value): void

// check if setting already exists
$data = mysqli_fetch_row(mysqli_query($db_link, "SELECT COUNT(*) FROM ".$table." WHERE type = '".$type."' AND intitule = '".$label."'"));
if ($data[0] == 0) {
if ((int) $data[0] === 0) {
// add setting
mysqli_query(
$db_link,
"INSERT INTO ".$pre."misc
"INSERT INTO ".$table."
(`type`, `intitule`, `valeur`)
VALUES ('".$type."', '".$label."', '".$value."')"
);
Expand All @@ -268,13 +268,12 @@ function removeSetting($table, $type, $label): void

// check if setting already exists
$data = mysqli_fetch_row(mysqli_query($db_link, "SELECT COUNT(*) FROM ".$table." WHERE type = '".$type."' AND intitule = '".$label."'"));
if ($data[0] == 0) {
if ((int) $data[0] === 1) {
// delete setting
DB::delete(
prefixTable('misc'),
'type = %s AND intitule = %s',
$type,
$label
mysqli_query(
$db_link,
"DELETE FROM ".$table."
WHERE type = '".$type."' AND intitule = '".$label."'"
);
}
}

0 comments on commit 6d6cfcb

Please sign in to comment.