Skip to content

Commit 6d6cfcb

Browse files
3.0.0.22
Small fixes
1 parent d5bf889 commit 6d6cfcb

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

api/Controller/Api/ItemController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ public function getAction(array $userData): void
113113
{
114114
$superGlobal = new protect\SuperGlobal\SuperGlobal();
115115
$strErrorDesc = '';
116+
$sqlExtra = '';
117+
$responseData = '';
118+
$strErrorHeader = '';
116119
$requestMethod = $superGlobal->get('REQUEST_METHOD', 'SERVER');
117120

118121
// get parameters

install/tp.functions.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,11 @@ function addNewSetting($table, $type, $label, $value): void
243243

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

269269
// check if setting already exists
270270
$data = mysqli_fetch_row(mysqli_query($db_link, "SELECT COUNT(*) FROM ".$table." WHERE type = '".$type."' AND intitule = '".$label."'"));
271-
if ($data[0] == 0) {
271+
if ((int) $data[0] === 1) {
272272
// delete setting
273-
DB::delete(
274-
prefixTable('misc'),
275-
'type = %s AND intitule = %s',
276-
$type,
277-
$label
273+
mysqli_query(
274+
$db_link,
275+
"DELETE FROM ".$table."
276+
WHERE type = '".$type."' AND intitule = '".$label."'"
278277
);
279278
}
280279
}

0 commit comments

Comments
 (0)