Passed
Push — master ( 5a3ed5...a919c1 )
by Nils
06:37 queued 14s
created
scripts/task_maintenance_reload_cache_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 function reloadCacheTable(): void
72 72
 {
73 73
     // Load expected files
74
-    require_once __DIR__. '/../sources/main.functions.php';
74
+    require_once __DIR__.'/../sources/main.functions.php';
75 75
 
76 76
     updateCacheTable('reload', NULL);
77 77
 }
78 78
\ No newline at end of file
Please login to merge, or discard this patch.
sources/items.logs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 ) {
75 75
     // Not allowed page
76 76
     $session->set('system-error_code', ERR_NOT_ALLOWED);
77
-    include $SETTINGS['cpassman_dir'] . '/error.php';
77
+    include $SETTINGS['cpassman_dir'].'/error.php';
78 78
     exit;
79 79
 }
80 80
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             
131 131
             if (
132 132
                 is_array($dataReceived) && // check if the data is an array
133
-                array_diff_key(array_flip($requiredKeys), $dataReceived) === [] &&  // check if all required keys have a valuekeys are present
133
+                array_diff_key(array_flip($requiredKeys), $dataReceived) === [] && // check if all required keys have a valuekeys are present
134 134
                 count(array_filter($dataReceived)) === count($requiredKeys) && // check if all required 
135 135
                 in_array($dataReceived['action'], ['at_password_shown', 'at_password_copied'], true) && // only log these actions
136 136
                 $session->get('user-id') === (int) filter_var($dataReceived['user_id'], FILTER_SANITIZE_NUMBER_INT) // only log actions of the current user
Please login to merge, or discard this patch.
includes/core/load.js.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
                             // Show passwords inputs and form
177 177
                             $('#dialog-user-change-password-info')
178
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('user_has_to_change_password_info');?>')
178
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('user_has_to_change_password_info'); ?>')
179 179
                                 .removeClass('hidden');
180 180
                             $('#dialog-user-change-password').removeClass('hidden');
181 181
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
                             // Show passwords inputs and form
190 190
                             $('#dialog-ldap-user-change-password-info')
191
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
191
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
192 192
                                 .removeClass('hidden');
193 193
                             $('#dialog-ldap-user-change-password').removeClass('hidden');
194 194
                             
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
                             if (data.queryResults.auth_type === 'oauth2') {
218 218
                                 // LDAP or local account to OAuth2 account
219
-                                var info_message = '<?php echo $lang->get('oauth2_need_user_old_password');?>';
219
+                                var info_message = '<?php echo $lang->get('oauth2_need_user_old_password'); ?>';
220 220
 
221 221
                                 // Hide the "new password" field that users can't fill in manually
222 222
                                 $('#new-password-field').hide();
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
                                 $('#dialog-ldap-user-change-password-current').val(oauth2_encryption_hash);
229 229
                             } else {
230 230
                                 // LDAP password updated
231
-                                var info_message = '<?php echo $lang->get('ldap_user_has_changed_his_password');?>';
231
+                                var info_message = '<?php echo $lang->get('ldap_user_has_changed_his_password'); ?>';
232 232
                             }
233 233
 
234 234
                             // Display info tip
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         /*console.log('User has to regenerate keys')
340 340
         // HIde
341 341
         $('.content-header, .content').addClass('hidden');
342
-        $('#dialog-user-temporary-code-info').html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('renecyption_expected');?>');
342
+        $('#dialog-user-temporary-code-info').html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('renecyption_expected'); ?>');
343 343
 
344 344
         // Show passwords inputs and form
345 345
         $('#dialog-user-temporary-code').removeClass('hidden');
@@ -421,13 +421,13 @@  discard block
 block discarded – undo
421 421
             {
422 422
                 if (step === 'psk') {
423 423
                     // Inform user
424
-                    $("#user-current-defuse-psk-progress").html('<b><?php echo $lang->get('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + '] ' +
424
+                    $("#user-current-defuse-psk-progress").html('<b><?php echo $lang->get('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + '] ' +
425 425
                         '... <?php echo $lang->get('please_wait'); ?><i class="fa-solid fa-spinner fa-pulse ml-3 text-primary"></i>');
426 426
 
427 427
                     var data = {
428 428
                         'userPsk' : $('#user-current-defuse-psk').val(),
429 429
                         'start': start,
430
-                        'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>,
430
+                        'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>,
431 431
                         'user_id': userId,
432 432
                         'counterItemsToTreat': counterItemsToTreat
433 433
                     };
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 
504 504
                 // Show passwords inputs and form
505 505
                 $('#dialog-ldap-user-change-password-info')
506
-                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
506
+                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
507 507
                     .removeClass('hidden');
508 508
                 $('#dialog-ldap-user-change-password').removeClass('hidden');
509 509
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
                                 '</div>' +
594 594
                             '</div>' +
595 595
                         '</div>' +
596
-                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1  ? '' : ' hidden'; ?>">' +
596
+                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1 ? '' : ' hidden'; ?>">' +
597 597
                             '<h6><?php echo $lang->get('provide_recovery_keys'); ?></h6>' +
598 598
                             '<div class="input-group mb-2">' +
599 599
                                 '<div class="input-group-prepend">' +
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
                                 '<textarea rows="2" id="recovery-private-key" class="form-control form-item-control"></textarea>' +
609 609
                             '</div>' +
610 610
                         '</div>' +
611
-                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1  ? '' : ' hidden'; ?>">' +
611
+                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1 ? '' : ' hidden'; ?>">' +
612 612
                             '<div class="alert" id="confirm-no-recovery-keys-div">' +
613 613
                                 '<div class="form-check">' +
614 614
                                     '<input type="checkbox" class="form-check-input" id="confirm-no-recovery-keys">' +
@@ -1172,15 +1172,15 @@  discard block
 block discarded – undo
1172 1172
             // Prepare data
1173 1173
             var data = {
1174 1174
                 'receipt': $('#temp-user-email').val(),
1175
-                'subject': '[Teampass] <?php echo $lang->get('your_new_password');?>',
1176
-                'body': '<?php echo $lang->get('email_body_temporary_login_password');?>',
1175
+                'subject': '[Teampass] <?php echo $lang->get('your_new_password'); ?>',
1176
+                'body': '<?php echo $lang->get('email_body_temporary_login_password'); ?>',
1177 1177
                 'pre_replace' : {
1178 1178
                     '#enc_code#' : $('#temp-user-pwd').val(),
1179 1179
                 }
1180 1180
             }
1181 1181
             if (debugJavascript === true) console.log(data);
1182 1182
             // Prepare form
1183
-            $('#dialog-admin-change-user-password-info').html('<?php echo $lang->get('sending_email_message');?>');
1183
+            $('#dialog-admin-change-user-password-info').html('<?php echo $lang->get('sending_email_message'); ?>');
1184 1184
             toastr.remove();
1185 1185
             toastr.info(
1186 1186
                 '<?php echo $lang->get('in_progress'); ?><i class="fa-solid fa-circle-notch fa-spin fa-2x ml-3"></i>'
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
                         '#warningModal',
1703 1703
                         '<i class="fa-solid fa-clock fa-lg warning mr-2"></i><?php echo $lang->get('index_add_one_hour'); ?>',
1704 1704
                         '<div class="form-group">' +
1705
-                        '<label for="warningModal-input" class="col-form-label"><?php echo $lang->get('extend_session_duration_by') . ' (' . $lang->get('minutes') . ')'; ?>:</label>' +
1705
+                        '<label for="warningModal-input" class="col-form-label"><?php echo $lang->get('extend_session_duration_by').' ('.$lang->get('minutes').')'; ?>:</label>' +
1706 1706
                         '<input type="number" max="'+(60*60*24)+'" class="form-control" id="warningModal-input" value="60">' +
1707 1707
                         '</div>' +
1708 1708
                         '<div class="form-text text-muted"><i class=\"fa-solid fa-info-circle mr-2\"></i><?php echo $lang->get('maximum_session_expiration_time'); ?>: '+data.max_session_duration+'</div>',
Please login to merge, or discard this patch.
api/inc/bootstrap.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
 
26 26
 use TeampassClasses\ConfigManager\ConfigManager;
27 27
 
28
-define("API_ROOT_PATH", __DIR__ . "/..");
28
+define("API_ROOT_PATH", __DIR__."/..");
29 29
 
30 30
 // include main configuration file
31
-require API_ROOT_PATH . '/../sources/main.functions.php';
31
+require API_ROOT_PATH.'/../sources/main.functions.php';
32 32
 
33 33
 // include the base controller file
34
-require API_ROOT_PATH . "/Controller/Api/BaseController.php";
34
+require API_ROOT_PATH."/Controller/Api/BaseController.php";
35 35
 
36 36
 // include the use model file
37
-require API_ROOT_PATH . "/Model/UserModel.php";
38
-require API_ROOT_PATH . "/Model/ItemModel.php";
39
-require API_ROOT_PATH . "/Model/FolderModel.php";
37
+require API_ROOT_PATH."/Model/UserModel.php";
38
+require API_ROOT_PATH."/Model/ItemModel.php";
39
+require API_ROOT_PATH."/Model/FolderModel.php";
40 40
 
41 41
 /**
42 42
  * Launch expected action for ITEM
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
         );
56 56
     }
57 57
     // Perform the action
58
-    require API_ROOT_PATH . "/Controller/Api/ItemController.php";    
58
+    require API_ROOT_PATH."/Controller/Api/ItemController.php";    
59 59
     $objFeedController = new ItemController();
60
-    $strMethodName = $actions[0] . 'Action';
60
+    $strMethodName = $actions[0].'Action';
61 61
     $objFeedController->{$strMethodName}($userData);
62 62
 }
63 63
 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
         );
79 79
     }
80 80
     // Perform the action
81
-    require API_ROOT_PATH . "/Controller/Api/FolderController.php";
81
+    require API_ROOT_PATH."/Controller/Api/FolderController.php";
82 82
     $objFeedController = new FolderController();
83
-    $strMethodName = $actions[0] . 'Action';
83
+    $strMethodName = $actions[0].'Action';
84 84
     $objFeedController->{$strMethodName}($userData);
85 85
 }
86 86
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  */
138 138
 function verifyAuth(): string
139 139
 {
140
-    include_once API_ROOT_PATH . '/inc/jwt_utils.php';
140
+    include_once API_ROOT_PATH.'/inc/jwt_utils.php';
141 141
     $bearer_token = get_bearer_token();
142 142
 
143 143
     if (empty($bearer_token) === false && is_jwt_valid($bearer_token) === true) {
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
  */
168 168
 function getDataFromToken(): string
169 169
 {
170
-    include_once API_ROOT_PATH . '/inc/jwt_utils.php';
170
+    include_once API_ROOT_PATH.'/inc/jwt_utils.php';
171 171
     $bearer_token = get_bearer_token();
172 172
 
173 173
     if (empty($bearer_token) === false) {
Please login to merge, or discard this patch.
api/Model/UserModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     {
30 30
         return DB::query(
31 31
             'SELECT * 
32
-            FROM ' . prefixTable('users') . '
32
+            FROM ' . prefixTable('users').'
33 33
             ORDER BY id ASC LIMIT %i',
34 34
             $limit
35 35
         );
Please login to merge, or discard this patch.
api/Model/FolderModel.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         // Get folders
38 38
         $rows = DB::query(
39 39
             'SELECT id, title
40
-            FROM ' . prefixTable('nested_tree') . '
40
+            FROM ' . prefixTable('nested_tree').'
41 41
             WHERE nlevel = %i',
42 42
             1
43 43
         );
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
         $ret = [];
70 70
         $childrens = DB::query(
71 71
             'SELECT id, title
72
-            FROM ' . prefixTable('nested_tree') . '
72
+            FROM ' . prefixTable('nested_tree').'
73 73
             WHERE parent_id = %i',
74 74
             $parentId
75 75
         );
76 76
 
77
-        if ( count($childrens) > 0) {
77
+        if (count($childrens) > 0) {
78 78
             foreach ($childrens as $children) {
79 79
 				$isVisible = in_array((int) $children['id'], $foldersId);
80 80
                 $childs = $this->getFoldersChildren($children['id'], $foldersId);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     ): array
117 117
     {
118 118
         // Validate inputs
119
-        include_once API_ROOT_PATH . '/../sources/main.functions.php';
119
+        include_once API_ROOT_PATH.'/../sources/main.functions.php';
120 120
         $data = [
121 121
             'title' => $title,
122 122
             'parent_id' => $parent_id,
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
                 'error' => true,
182 182
                 'error_header' => 'HTTP/1.1 422 Unprocessable Entity',
183 183
                 'error_message' => 'Invalid parameters'
184
-            ];}
184
+            ]; }
185 185
 
186 186
         // Create folder
187 187
         require_once TEAMPASS_ROOT_PATH.'/sources/folders.class.php';
Please login to merge, or discard this patch.
api/Model/AuthModel.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function getUserAuth(string $login, string $password, string $apikey): array
50 50
     {
51 51
         // Sanitize
52
-        include_once API_ROOT_PATH . '/../sources/main.functions.php';
52
+        include_once API_ROOT_PATH.'/../sources/main.functions.php';
53 53
         $inputData = dataSanitizer(
54 54
             [
55 55
                 'login' => isset($login) === true ? $login : '',
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
             // Check if user exists
75 75
             $userInfo = DB::queryfirstrow(
76 76
                 "SELECT u.id, u.pw, u.login, u.admin, u.gestionnaire, u.can_manage_all_users, u.fonction_id, u.can_create_root_folder, u.public_key, u.private_key, u.personal_folder, u.fonction_id, u.groupes_visibles, u.groupes_interdits, a.value AS user_api_key, a.allowed_folders as user_api_allowed_folders, a.enabled, a.allowed_to_create, a.allowed_to_read, a.allowed_to_update, a.allowed_to_delete
77
-                FROM " . prefixTable('users') . " AS u
78
-                INNER JOIN " . prefixTable('api') . " AS a ON (a.user_id=u.id)
77
+                FROM " . prefixTable('users')." AS u
78
+                INNER JOIN " . prefixTable('api')." AS a ON (a.user_id=u.id)
79 79
                 WHERE login = %s",
80 80
                 $inputData['login']
81 81
             );
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         if (count($userFunctionId) > 0) {
252 252
             $rows = DB::query(
253 253
                 'SELECT * 
254
-                FROM ' . prefixTable('roles_values') . '
254
+                FROM ' . prefixTable('roles_values').'
255 255
                 WHERE role_id IN %li  AND type IN ("W", "ND", "NE", "NDNE", "R")',
256 256
                 $userFunctionId
257 257
             );
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         $inc = 0;
278 278
         $rows = DB::query(
279 279
             'SELECT id, id_tree 
280
-            FROM ' . prefixTable('items') . '
280
+            FROM ' . prefixTable('items').'
281 281
             WHERE restricted_to LIKE %s'.
282 282
             (count($userFunctionId) > 0 ? ' AND id_tree NOT IN %li' : ''),
283 283
             $userInfo['id'],
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
         // Check for the users roles if some specific rights exist on items
293 293
         $rows = DB::query(
294 294
             'SELECT i.id_tree, r.item_id
295
-            FROM ' . prefixTable('items') . ' AS i
296
-            INNER JOIN ' . prefixTable('restriction_to_roles') . ' AS r ON (r.item_id=i.id)
295
+            FROM ' . prefixTable('items').' AS i
296
+            INNER JOIN ' . prefixTable('restriction_to_roles').' AS r ON (r.item_id=i.id)
297 297
             WHERE '.(count($userFunctionId) > 0 ? ' id_tree NOT IN %li AND ' : '').' i.id_tree != ""
298 298
             ORDER BY i.id_tree ASC',
299 299
             count($userFunctionId) > 0 ? $userFunctionId : DB::sqleval('0')
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         // Add all personal folders
310 310
         $rows = DB::queryFirstRow(
311 311
             'SELECT id 
312
-            FROM ' . prefixTable('nested_tree') . '
312
+            FROM ' . prefixTable('nested_tree').'
313 313
             WHERE title = %i AND personal_folder = 1'.
314 314
             (count($userFunctionId) > 0 ? ' AND id NOT IN %li' : ''),
315 315
             $userInfo['id'],
Please login to merge, or discard this patch.
api/Model/ItemModel.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
         // Get items
51 51
         $rows = DB::query(
52 52
             'SELECT i.id, label, description, i.pw, i.url, i.id_tree, i.login, i.email, i.viewed_no, i.fa_icon, i.inactif, i.perso, t.title as folder_label
53
-            FROM ' . prefixTable('items') . ' AS i
53
+            FROM ' . prefixTable('items').' AS i
54 54
             LEFT JOIN '.prefixTable('nested_tree').' as t ON (t.id = i.id_tree) '.
55
-            $sqlExtra . 
56
-            " ORDER BY i.id ASC" .
57
-            ($limit > 0 ? " LIMIT ". $limit : '')
55
+            $sqlExtra. 
56
+            " ORDER BY i.id ASC".
57
+            ($limit > 0 ? " LIMIT ".$limit : '')
58 58
         );
59 59
 
60 60
         $ret = [];
61 61
         foreach ($rows as $row) {
62 62
             $userKey = DB::queryfirstrow(
63 63
                 'SELECT share_key
64
-                FROM ' . prefixTable('sharekeys_items') . '
64
+                FROM ' . prefixTable('sharekeys_items').'
65 65
                 WHERE user_id = %i AND object_id = %i',
66 66
                 $userId,
67 67
                 $row['id']
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 if (empty($path) === true) {
99 99
                     $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
100 100
                 } else {
101
-                    $path .= '/' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
101
+                    $path .= '/'.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
102 102
                 }
103 103
             }
104 104
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     ) : array
149 149
     {
150 150
         try {
151
-            include_once API_ROOT_PATH . '/../sources/main.functions.php';
151
+            include_once API_ROOT_PATH.'/../sources/main.functions.php';
152 152
 
153 153
             // Load config
154 154
             $configManager = new ConfigManager();
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         }
272 272
 
273 273
         if (strlen($password) > $SETTINGS['pwd_maximum_length']) {
274
-            throw new Exception('Password is too long (max allowed is ' . $SETTINGS['pwd_maximum_length'] . ' characters)');
274
+            throw new Exception('Password is too long (max allowed is '.$SETTINGS['pwd_maximum_length'].' characters)');
275 275
         }
276 276
     }
277 277
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
     {
285 285
         $dataFolderSettings = DB::queryFirstRow(
286 286
             'SELECT bloquer_creation, bloquer_modification, personal_folder
287
-            FROM ' . prefixTable('nested_tree') . ' 
287
+            FROM ' . prefixTable('nested_tree').' 
288 288
             WHERE id = %i',
289 289
             $folderId
290 290
         );
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
     {
308 308
         $folderComplexity = DB::queryFirstRow(
309 309
             'SELECT valeur
310
-            FROM ' . prefixTable('misc') . '
310
+            FROM ' . prefixTable('misc').'
311 311
             WHERE type = %s AND intitule = %i',
312 312
             'complex',
313 313
             $itemInfos['folderId']
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     private function checkForDuplicates(string $label, array $SETTINGS, array $itemInfos) : void
336 336
     {
337 337
         DB::queryFirstRow(
338
-            'SELECT * FROM ' . prefixTable('items') . '
338
+            'SELECT * FROM '.prefixTable('items').'
339 339
             WHERE label = %s AND inactif = %i',
340 340
             $label,
341 341
             0
Please login to merge, or discard this patch.
api/Controller/Api/ItemController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             // SQL where clause with folders list
56 56
             if (isset($arrQueryStringParams['folders']) === true) {
57 57
                 // convert the folders to an array
58
-                $arrQueryStringParams['folders'] = explode(',', str_replace( array('[',']') , ''  , $arrQueryStringParams['folders']));
58
+                $arrQueryStringParams['folders'] = explode(',', str_replace(array('[', ']'), '', $arrQueryStringParams['folders']));
59 59
 
60 60
                 // ensure to only use the intersection
61 61
                 $foldersList = implode(',', array_intersect($arrQueryStringParams['folders'], $userData['folders_list']));
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                 } else {
217 217
                     // Gérer le cas où les paramètres ne sont pas un tableau
218 218
                     $strErrorDesc = 'Data not consistent';
219
-                    $strErrorHeader = 'Expected array, received ' . gettype($arrQueryStringParams);
219
+                    $strErrorHeader = 'Expected array, received '.gettype($arrQueryStringParams);
220 220
                 }
221 221
             }
222 222
         } else {
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
             // SQL where clause with item id
264 264
             if (isset($arrQueryStringParams['id']) === true) {
265 265
                 // build sql where clause by ID
266
-                $sqlExtra = ' WHERE i.id = '.$arrQueryStringParams['id'] . $sql_constraint;
266
+                $sqlExtra = ' WHERE i.id = '.$arrQueryStringParams['id'].$sql_constraint;
267 267
             } else if (isset($arrQueryStringParams['label']) === true) {
268 268
                 // build sql where clause by LABEL
269
-                $sqlExtra = ' WHERE i.label '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['label'] : ' = '.$arrQueryStringParams['label']) . $sql_constraint;
269
+                $sqlExtra = ' WHERE i.label '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['label'] : ' = '.$arrQueryStringParams['label']).$sql_constraint;
270 270
             } else if (isset($arrQueryStringParams['description']) === true) {
271 271
                 // build sql where clause by LABEL
272 272
                 $sqlExtra = ' WHERE i.description '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['description'] : ' = '.$arrQueryStringParams['description']).$sql_constraint;
Please login to merge, or discard this patch.