Passed
Pull Request — master (#4837)
by
unknown
12:31
created
pages/users.js.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('users') === false) {
73 73
     // Not allowed page
74 74
     $session->set('system-error_code', ERR_NOT_ALLOWED);
75
-    include $SETTINGS['cpassman_dir'] . '/error.php';
75
+    include $SETTINGS['cpassman_dir'].'/error.php';
76 76
     exit;
77 77
 }
78 78
 ?>
@@ -325,8 +325,8 @@  discard block
 block discarded – undo
325 325
         if (store.get('teampassApplication').formUserAction === "add_new_user") {
326 326
             var data = {
327 327
                 'receipt': $('#form-email').val(),
328
-                'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code');?>',
329
-                'body': '<?php echo $lang->get('email_body_new_user');?>',
328
+                'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code'); ?>',
329
+                'body': '<?php echo $lang->get('email_body_new_user'); ?>',
330 330
                 'pre_replace' : {
331 331
                     '#code#' : store.get('teampassUser').admin_new_user_temporary_encryption_code,
332 332
                     '#login#' : store.get('teampassUser').admin_new_user_login,
@@ -336,8 +336,8 @@  discard block
 block discarded – undo
336 336
         } else {
337 337
             var data = {
338 338
                 'receipt': $('#form-email').val(),
339
-                'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code');?>',
340
-                'body': '<?php echo $lang->get('email_body_temporary_encryption_code');?>',
339
+                'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code'); ?>',
340
+                'body': '<?php echo $lang->get('email_body_temporary_encryption_code'); ?>',
341 341
                 'pre_replace' : {
342 342
                     '#enc_code#' : store.get('teampassUser').admin_new_user_temporary_encryption_code,
343 343
                 }
@@ -532,14 +532,14 @@  discard block
 block discarded – undo
532 532
             }
533 533
             // Inform user
534 534
             $("#warningModalBody").html('<b><?php echo $lang->get('encryption_keys'); ?> - ' +
535
-                stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + ']<span id="warningModalBody_extra">' + $nbItemsToConvert + '</span> ' +
535
+                stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + ']<span id="warningModalBody_extra">' + $nbItemsToConvert + '</span> ' +
536 536
                 '... <?php echo $lang->get('please_wait'); ?><i class="fa-solid fa-spinner fa-pulse ml-3 text-primary"></i>');
537 537
 
538 538
             // If expected, show the OPT to the admin
539 539
             if (constVisibleOTP === true) {
540 540
                 toastr.info(
541
-                    '<?php echo $lang->get('show_encryption_code_to_admin');?> <div><input class="form-control form-item-control flex-nowrap" value="' + userTemporaryCode + '" readonly></div>'
542
-                    + '<br /><button type="button" class="btn clear"><?php echo $lang->get('close');?></button>',
541
+                    '<?php echo $lang->get('show_encryption_code_to_admin'); ?> <div><input class="form-control form-item-control flex-nowrap" value="' + userTemporaryCode + '" readonly></div>'
542
+                    + '<br /><button type="button" class="btn clear"><?php echo $lang->get('close'); ?></button>',
543 543
                     '<?php echo $lang->get('information'); ?>',
544 544
                     {
545 545
                         extendedTimeOut: 0,
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
             var data = {
559 559
                 action: step,
560 560
                 start: start,
561
-                length: <?php echo NUMBER_ITEMS_IN_BATCH;?>,
561
+                length: <?php echo NUMBER_ITEMS_IN_BATCH; ?>,
562 562
                 user_id: userId,
563 563
             }
564 564
             if (debugJavascript === true) {
@@ -1395,7 +1395,7 @@  discard block
 block discarded – undo
1395 1395
                         } else {
1396 1396
                             // Show icon or not
1397 1397
                             if ($('#user-disabled').prop('checked') === true) {
1398
-                                $('#user-login-'+userID).before('<i class="fa-solid fa-user-slash infotip text-danger mr-2" title="<?php echo $lang->get('account_is_locked');?>" id="user-disable-'+userID+'"></i>');
1398
+                                $('#user-login-'+userID).before('<i class="fa-solid fa-user-slash infotip text-danger mr-2" title="<?php echo $lang->get('account_is_locked'); ?>" id="user-disable-'+userID+'"></i>');
1399 1399
                             } else {
1400 1400
                                 $('#user-disable-'+userID).remove();
1401 1401
                             }
Please login to merge, or discard this patch.
pages/users.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('users') === false) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
@@ -92,24 +92,24 @@  discard block
 block discarded – undo
92 92
 // If administrator then all roles are shown
93 93
 // else only the Roles the users is associated to.
94 94
 if ((int) $session->get('user-admin') === 1) {
95
-    $optionsManagedBy .= '<option value="0">' . $lang->get('administrators_only') . '</option>';
95
+    $optionsManagedBy .= '<option value="0">'.$lang->get('administrators_only').'</option>';
96 96
 }
97 97
 
98 98
 $rows = DB::query(
99 99
     'SELECT id, title, creator_id
100
-    FROM ' . prefixTable('roles_title') . '
100
+    FROM ' . prefixTable('roles_title').'
101 101
     ORDER BY title ASC'
102 102
 );
103 103
 foreach ($rows as $record) {
104 104
     if ((int) $session->get('user-admin') === 1 || in_array($record['id'], $session->get('user-roles_array')) === true) {
105
-        $optionsManagedBy .= '<option value="' . $record['id'] . '">' . $lang->get('managers_of') . ' ' . addslashes($record['title']) . '</option>';
105
+        $optionsManagedBy .= '<option value="'.$record['id'].'">'.$lang->get('managers_of').' '.addslashes($record['title']).'</option>';
106 106
     }
107 107
     if (
108 108
         (int) $session->get('user-admin') === 1
109 109
         || (((int) $session->get('user-manager') === 1 || (int) $session->get('user-can_manage_all_users') === 1)
110 110
             && (in_array($record['id'], $userRoles) === true) || (int) $record['creator_id'] === (int) $session->get('user-id'))
111 111
     ) {
112
-        $optionsRoles .= '<option value="' . $record['id'] . '">' . addslashes($record['title']) . '</option>';
112
+        $optionsRoles .= '<option value="'.$record['id'].'">'.addslashes($record['title']).'</option>';
113 113
     }
114 114
 }
115 115
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         for ($y = 1; $y < $t->nlevel; ++$y) {
125 125
             $ident .= '&nbsp;&nbsp;';
126 126
         }
127
-        $foldersList .= '<option value="' . $t->id . '">' . $ident . htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8') . '</option>';
127
+        $foldersList .= '<option value="'.$t->id.'">'.$ident.htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8').'</option>';
128 128
     }
129 129
 }
130 130
 
@@ -161,13 +161,13 @@  discard block
 block discarded – undo
161 161
                         </button><?php
162 162
                                     echo isset($SETTINGS['ldap_mode']) === true && (int) $SETTINGS['ldap_mode'] === 1 && (int) $session->get('user-admin') === 1 ?
163 163
                                         '<button type="button" class="btn btn-primary btn-sm tp-action mr-2" data-action="ldap-sync">
164
-                            <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization') . '
164
+                            <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization').'
165 165
                         </button>' : '';
166 166
                                     ?>
167 167
                         </button><?php
168 168
                                     echo isset($SETTINGS['oauth2_enabled']) === true && (int) $SETTINGS['oauth2_enabled'] === 1 && (int) $session->get('user-admin') === 1 ?
169 169
                                         '<button type="button" class="btn btn-primary btn-sm tp-action mr-2" data-action="oauth2-sync">
170
-                            <i class="fa-solid fa-plug mr-2"></i>' . $lang->get('oauth2_synchronization') . '
170
+                            <i class="fa-solid fa-plug mr-2"></i>' . $lang->get('oauth2_synchronization').'
171 171
                         </button>' : '';
172 172
                                     ?>
173 173
                     </h3>
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
                 <!-- /.card-header -->
177 177
                 <div class="card-body form" id="users-list">
178
-                    <label><input type="checkbox" id="warnings_display" class="tp-action pointer" data-action="refresh"><span class="ml-2 pointer"><?php echo $lang->get('display_warning_icons');?></span></label>
178
+                    <label><input type="checkbox" id="warnings_display" class="tp-action pointer" data-action="refresh"><span class="ml-2 pointer"><?php echo $lang->get('display_warning_icons'); ?></span></label>
179 179
                     <table id="table-users" class="table table-striped nowrap table-responsive-sm">
180 180
                         <thead>
181 181
                             <tr>
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
                                             <?php
240 240
                                             foreach (TP_PW_COMPLEXITY as $entry) {
241 241
                                                 echo '
242
-                                            <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>';
242
+                                            <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>';
243 243
                                             }
244 244
                                             ?>
245 245
                                         </select>
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
                                             <?php
317 317
                                             foreach (TP_PW_COMPLEXITY as $entry) {
318 318
                                                 echo '
319
-                                            <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>';
319
+                                            <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>';
320 320
                                             }
321 321
                                             ?>
322 322
                                         </select>
Please login to merge, or discard this patch.
sources/users.datatable.php 1 patch
Spacing   +15 added lines, -17 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 ) {
78 78
     // Not allowed page
79 79
     $session->set('system-error_code', ERR_NOT_ALLOWED);
80
-    include $SETTINGS['cpassman_dir'] . '/error.php';
80
+    include $SETTINGS['cpassman_dir'].'/error.php';
81 81
     exit;
82 82
 }
83 83
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     if (isset($order['column']) && preg_match('#^(asc|desc)$#i', $order['dir'])) {
129 129
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
130 130
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
131
-        $sOrder .= $aColumns[$columnIndex] . ' ' . $dir . ', ';
131
+        $sOrder .= $aColumns[$columnIndex].' '.$dir.', ';
132 132
     }
133 133
 
134 134
     $sOrder = substr_replace($sOrder, '', -2);
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
 
153 153
 if ($letter !== '' && $letter !== 'None') {
154 154
     $sWhere .= ' AND (';
155
-    $sWhere .= $aColumns[1] . " LIKE '" . $letter . "%' OR ";
156
-    $sWhere .= $aColumns[2] . " LIKE '" . $letter . "%' OR ";
157
-    $sWhere .= $aColumns[3] . " LIKE '" . $letter . "%' ";
155
+    $sWhere .= $aColumns[1]." LIKE '".$letter."%' OR ";
156
+    $sWhere .= $aColumns[2]." LIKE '".$letter."%' OR ";
157
+    $sWhere .= $aColumns[3]." LIKE '".$letter."%' ";
158 158
     $sWhere .= ')';
159 159
 } elseif ($searchValue !== '') {
160 160
     $sWhere .= ' AND (';
161
-    $sWhere .= $aColumns[1] . " LIKE '" . $searchValue . "%' OR ";
162
-    $sWhere .= $aColumns[2] . " LIKE '" . $searchValue . "%' OR ";
163
-    $sWhere .= $aColumns[3] . " LIKE '" . $searchValue . "%' ";
161
+    $sWhere .= $aColumns[1]." LIKE '".$searchValue."%' OR ";
162
+    $sWhere .= $aColumns[2]." LIKE '".$searchValue."%' OR ";
163
+    $sWhere .= $aColumns[3]." LIKE '".$searchValue."%' ";
164 164
     $sWhere .= ')';
165 165
 }
166 166
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         // Check for existing lock
247 247
         $unlock_at = DB::queryFirstField(
248 248
             'SELECT MAX(unlock_at)
249
-             FROM ' . prefixTable('auth_failures') . '
249
+             FROM ' . prefixTable('auth_failures').'
250 250
              WHERE unlock_at > %s AND source = %s AND value = %s',
251 251
             date('Y-m-d H:i:s', time()),
252 252
             'login',
@@ -255,33 +255,31 @@  discard block
 block discarded – undo
255 255
 
256 256
         // Get some infos about user
257 257
         $userDisplayInfos = 
258
-            (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '')
258
+            (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '')
259 259
             .
260 260
             ((int) $record['last_connexion'] > 0 ? '<i class=\"far fa-clock infotip text-info ml-2\" title=\"'.$lang->get('index_last_seen').": ".
261
-            date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '')
261
+            date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '')
262 262
             .
263 263
             ((int) $record['user_ip'] > 0 ? '<i class=\"fas fa-street-view infotip text-info ml-1\" title=\"'.$lang->get('ip').": ".($record['user_ip']).'\"></i>' : '')
264 264
             .
265 265
             (($record['auth_type'] === 'ldap' || $record['auth_type'] === 'oauth2') ? '<i class=\"far fa-address-book infotip text-warning ml-1\" title=\"'.$lang->get('managed_through_ad').'\"></i>' : '')
266 266
             .
267 267
             ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && ((int) $SETTINGS['duo'] === 1 || (int) $SETTINGS['google_authentication'] === 1)) ?
268
-                ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') :
269
-                ''
268
+                ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') : ''
270 269
                 )
271 270
             .
272 271
             (($unlock_at) ? '<i class=\"fas fa-solid text-red fa-lock infotip text-info ml-1\" title=\"'.$lang->get('bruteforce_unlock_at').$unlock_at.'\"></i>' : '');
273 272
         if ($request->query->filter('display_warnings', '', FILTER_VALIDATE_BOOLEAN) === true) {
274 273
             $userDisplayInfos .= '<br>'.
275 274
                 ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && is_null($record['keys_recovery_time']) === true) ? 
276
-                    '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' :
277
-                    ''
275
+                    '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' : ''
278 276
                 ).
279 277
                 ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['pw_passwordlib'] === 1) ? '<i class=\"fa-solid fa-person-walking-luggage infotip ml-1\" style=\"color:Tomato\" title=\"Old password encryption. Shall login to initialize.\"></i>' : '');
280 278
         }
281 279
 
282 280
         $sOutput .= '["<span data-id=\"'.$record['id'].'\" data-fullname=\"'.
283
-            (empty($record['name']) === false ? htmlentities($record['name'], ENT_QUOTES|ENT_SUBSTITUTE|ENT_DISALLOWED) : '').' '.
284
-            (empty($record['lastname']) === false ? htmlentities($record['lastname'], ENT_QUOTES|ENT_SUBSTITUTE|ENT_DISALLOWED) : '').
281
+            (empty($record['name']) === false ? htmlentities($record['name'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED) : '').' '.
282
+            (empty($record['lastname']) === false ? htmlentities($record['lastname'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED) : '').
285 283
             '\" data-auth-type=\"'.$record['auth_type'].'\" data-special=\"'.$record['special'].'\" data-mfa-enabled=\"'.$record['mfa_enabled'].'\" data-otp-provided=\"'.(isset($record['otp_provided']) === true ? $record['otp_provided'] : '').'\"></span>", ';
286 284
         //col2
287 285
         $sOutput .= '"'.
Please login to merge, or discard this patch.
pages/oauth.js.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('oauth') === false) {
72 72
     // Not allowed page
73 73
     $session->set('system-error_code', ERR_NOT_ALLOWED);
74
-    include $SETTINGS['cpassman_dir'] . '/error.php';
74
+    include $SETTINGS['cpassman_dir'].'/error.php';
75 75
     exit;
76 76
 }
77 77
 ?>
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                     if (data[i].selected_role === 1) {
227 227
                         selected_role = data[i].id;
228 228
                     }
229
-                    html_admin_by += '<option value="' + data[i].id + '"><?php echo $lang->get('managers_of') . ' '; ?>' + data[i].title + '</option>';
229
+                    html_admin_by += '<option value="' + data[i].id + '"><?php echo $lang->get('managers_of').' '; ?>' + data[i].title + '</option>';
230 230
                     html_roles += '<option value="' + data[i].id + '">' + data[i].title + '</option>';
231 231
                 }
232 232
                 $('#oauth_new_user_is_administrated_by')
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             }).fail(function(error) {
256 256
                 toastr.remove();
257 257
                 toastr.error(
258
-                    '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + error,
258
+                    '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + error,
259 259
                     '', {
260 260
                         closeButton: true,
261 261
                         positionClass: 'toast-bottom-right'
Please login to merge, or discard this patch.
pages/admin.js.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) {
69 69
     // Not allowed page
70 70
     $session->set('system-error_code', ERR_NOT_ALLOWED);
71
-    include $SETTINGS['cpassman_dir'] . '/error.php';
71
+    include $SETTINGS['cpassman_dir'].'/error.php';
72 72
     exit;
73 73
 }
74 74
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
                     // error
170 170
                     toastr.remove();
171 171
                     toastr.error(
172
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
172
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
173 173
                         '', {
174 174
                             closeButton: true,
175 175
                             positionClass: 'toast-bottom-right'
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                     // error
249 249
                     toastr.remove();
250 250
                     toastr.error(
251
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
251
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
252 252
                         '', {
253 253
                             closeButton: true,
254 254
                             positionClass: 'toast-bottom-right'
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                     // error
311 311
                     toastr.remove();
312 312
                     toastr.error(
313
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
313
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
314 314
                         '', {
315 315
                             closeButton: true,
316 316
                             positionClass: 'toast-bottom-right'
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                     // error
405 405
                     toastr.remove();
406 406
                     toastr.error(
407
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
407
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
408 408
                         '', {
409 409
                             closeButton: true,
410 410
                             positionClass: 'toast-bottom-right'
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
                     
434 434
                     //const className = result.success ? 'success' : 'error';
435 435
                     const icon = result.success ? '<i class="fa-solid fa-check text-success mr-1"></i>' : '<i class="fa-solid fa-xmark text-danger mr-1"></i>';
436
-                    const message = result.success ? '<?php echo $lang->get('server_returned_data');?>' : 'Error: ' + result.error;
436
+                    const message = result.success ? '<?php echo $lang->get('server_returned_data'); ?>' : 'Error: ' + result.error;
437 437
                     
438 438
                     output += '<li>' + icon + '<b>' + file + '</b><br/>' + message + '</li>';
439 439
                 });
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
                     // error
465 465
                     toastr.remove();
466 466
                     toastr.error(
467
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
467
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
468 468
                         '', {
469 469
                             closeButton: true,
470 470
                             positionClass: 'toast-bottom-right'
Please login to merge, or discard this patch.
pages/items.js.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('items') === false) {
73 73
     // Not allowed page
74 74
     $session->set('system-error_code', ERR_NOT_ALLOWED);
75
-    include $SETTINGS['cpassman_dir'] . '/error.php';
75
+    include $SETTINGS['cpassman_dir'].'/error.php';
76 76
     exit;
77 77
 }
78 78
 
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
             //
1057 1057
         } else if ($(this).data('item-action') === 'link') {
1058 1058
             // Add link to clipboard.
1059
-            navigator.clipboard.writeText("<?php echo $SETTINGS['cpassman_url'];?>/index.php?page=items&group="+store.get('teampassItem').folderId+"&id="+store.get('teampassItem').id);
1059
+            navigator.clipboard.writeText("<?php echo $SETTINGS['cpassman_url']; ?>/index.php?page=items&group="+store.get('teampassItem').folderId+"&id="+store.get('teampassItem').id);
1060 1060
 
1061 1061
             // Display message.
1062 1062
             toastr.remove();
@@ -2698,7 +2698,7 @@  discard block
 block discarded – undo
2698 2698
                 progress: "#form-item-password-strength",
2699 2699
                 score: "#form-item-password-strength"
2700 2700
             },
2701
-            scores: [<?php echo TP_PW_STRENGTH_1;?>, <?php echo TP_PW_STRENGTH_2;?>, <?php echo TP_PW_STRENGTH_3;?>, <?php echo TP_PW_STRENGTH_4;?>, <?php echo TP_PW_STRENGTH_5;?>],
2701
+            scores: [<?php echo TP_PW_STRENGTH_1; ?>, <?php echo TP_PW_STRENGTH_2; ?>, <?php echo TP_PW_STRENGTH_3; ?>, <?php echo TP_PW_STRENGTH_4; ?>, <?php echo TP_PW_STRENGTH_5; ?>],
2702 2702
         },
2703 2703
         i18n : {
2704 2704
             t: function (key) {
@@ -2725,7 +2725,7 @@  discard block
 block discarded – undo
2725 2725
     <?php
2726 2726
     $max_file_size = '';
2727 2727
     if (strrpos($SETTINGS['upload_maxfilesize'], 'mb') === false) {
2728
-        $max_file_size = $SETTINGS['upload_maxfilesize'] . 'mb';
2728
+        $max_file_size = $SETTINGS['upload_maxfilesize'].'mb';
2729 2729
     } else {
2730 2730
         $max_file_size = $SETTINGS['upload_maxfilesize'];
2731 2731
     }
@@ -4647,7 +4647,7 @@  discard block
 block discarded – undo
4647 4647
                         (retData.edition_locked_delay === null ? 
4648 4648
                         '' 
4649 4649
                         :
4650
-                        ' : ' + retData.edition_locked_delay + ' <?php echo $lang->get('seconds');?>'),
4650
+                        ' : ' + retData.edition_locked_delay + ' <?php echo $lang->get('seconds'); ?>'),
4651 4651
                     '', {
4652 4652
                         timeOut: 5000,
4653 4653
                         progressBar: true
@@ -4804,7 +4804,7 @@  discard block
 block discarded – undo
4804 4804
 
4805 4805
                             // Show passwords inputs and form
4806 4806
                             $('#dialog-ldap-user-change-password-info')
4807
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
4807
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
4808 4808
                                 .removeClass('hidden');
4809 4809
                             $('#dialog-ldap-user-change-password').removeClass('hidden');
4810 4810
                         } else if (data.error_type !== 'undefined') {
@@ -4823,7 +4823,7 @@  discard block
 block discarded – undo
4823 4823
 
4824 4824
                                 // Show passwords inputs and form
4825 4825
                                 $('#dialog-ldap-user-change-password-info')
4826
-                                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
4826
+                                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
4827 4827
                                     .removeClass('hidden');
4828 4828
                                 $('#dialog-ldap-user-change-password').removeClass('hidden');
4829 4829
                             });
Please login to merge, or discard this patch.
pages/options.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('options') === false) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
                                     // get list of all timezones
323 323
                                     foreach ($zones as $key => $zone) {
324 324
                                         echo '
325
-                                <option value="' . $key . '"', isset($SETTINGS['timezone']) === true && (int) $SETTINGS['timezone'] === $key ? ' selected' : '', '>' . $zone . '</option>';
325
+                                <option value="' . $key.'"', isset($SETTINGS['timezone']) === true && (int) $SETTINGS['timezone'] === $key ? ' selected' : '', '>'.$zone.'</option>';
326 326
                                     }
327 327
                                     ?>
328 328
                                 </select>
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
                                     $languagesList = $languagesList ?? [];
375 375
                                     foreach ($languagesList as $teampassLang) {
376 376
                                         echo '
377
-                                <option value="' . $teampassLang . '"', isset($SETTINGS['default_language']) === true && (int) $SETTINGS['default_language'] === $teampassLang ? ' selected' : '', '>' . $teampassLang . '</option>';
377
+                                <option value="' . $teampassLang.'"', isset($SETTINGS['default_language']) === true && (int) $SETTINGS['default_language'] === $teampassLang ? ' selected' : '', '>'.$teampassLang.'</option>';
378 378
                                     }
379 379
                                     ?>
380 380
                                 </select>
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
                                 <?php
472 472
                                 foreach (TP_PW_COMPLEXITY as $complex) {
473 473
                                     echo '
474
-                                <option value="' . $complex[0] . '"', isset($SETTINGS['personal_saltkey_security_level']) === true && (int) $SETTINGS['personal_saltkey_security_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>';
474
+                                <option value="' . $complex[0].'"', isset($SETTINGS['personal_saltkey_security_level']) === true && (int) $SETTINGS['personal_saltkey_security_level'] === $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>';
475 475
                                 }
476 476
                                 ?>
477 477
                             </select>
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
                                         $roles = getRolesTitles();
849 849
                                         foreach ($roles as $role) {
850 850
                                             echo '
851
-                                    <option value="' . htmlspecialchars($role['id']) . '"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>' . htmlspecialchars(addslashes($role['title'])) . '</option>';
851
+                                    <option value="' . htmlspecialchars($role['id']).'"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>'.htmlspecialchars(addslashes($role['title'])).'</option>';
852 852
                                         }
853 853
                                     }
854 854
                                     ?>
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
                                     <?php
1076 1076
                                     foreach (TP_PW_COMPLEXITY as $complex) {
1077 1077
                                         echo '
1078
-                                <option value="' . $complex[0] . '"', isset($SETTINGS['offline_key_level']) === true && (int) $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>';
1078
+                                <option value="' . $complex[0].'"', isset($SETTINGS['offline_key_level']) === true && (int) $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>';
1079 1079
                                     }
1080 1080
                                     ?>
1081 1081
                                 </select>
Please login to merge, or discard this patch.
sources/upload.files.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 ) {
77 77
     // Not allowed page
78 78
     $session->set('system-error_code', ERR_NOT_ALLOWED);
79
-    include $SETTINGS['cpassman_dir'] . '/error.php';
79
+    include $SETTINGS['cpassman_dir'].'/error.php';
80 80
     exit;
81 81
 }
82 82
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     } else {
131 131
         // check if token is expired
132 132
         $data = DB::queryFirstRow(
133
-            'SELECT end_timestamp FROM ' . prefixTable('tokens') . ' WHERE user_id = %i AND token = %s',
133
+            'SELECT end_timestamp FROM '.prefixTable('tokens').' WHERE user_id = %i AND token = %s',
134 134
             $session->get('user-id'),
135 135
             $post_user_token
136 136
         );
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
 // HTTP headers for no cache etc
156 156
 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
157
-header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
157
+header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
158 158
 header('Cache-Control: no-store, no-cache, must-revalidate');
159 159
 header('Cache-Control: post-check=0, pre-check=0', false);
160 160
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     }
167 167
 
168 168
     // Set directory used to store file
169
-    $targetDir = realpath($SETTINGS['cpassman_dir'] . '/includes/avatars');
169
+    $targetDir = realpath($SETTINGS['cpassman_dir'].'/includes/avatars');
170 170
 } else {
171 171
     $targetDir = realpath($SETTINGS['path_to_files_folder']);
172 172
 }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     $file_name = preg_replace('/[^a-zA-Z0-9-_\.]/', '', strtolower(basename($file->getClientOriginalName())));
220 220
     
221 221
     if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) {
222
-        error_log('Invalid file name: ' . $file_name . '.');
222
+        error_log('Invalid file name: '.$file_name.'.');
223 223
         echo handleUploadError('Invalid file name provided.');
224 224
         return false;
225 225
     }
@@ -233,13 +233,13 @@  discard block
 block discarded – undo
233 233
             $ext = strtolower($ext);
234 234
         } else {
235 235
             // Case where the file extension is not a string
236
-            error_log('Invalid file name: ' . $file_name . '.');
236
+            error_log('Invalid file name: '.$file_name.'.');
237 237
             echo handleUploadError('Invalid file extension.');
238 238
             return false;
239 239
         }
240 240
     } else {
241 241
         // Case where the file name is not a string
242
-        error_log('Invalid file name: ' . $file_name . '.');
242
+        error_log('Invalid file name: '.$file_name.'.');
243 243
         echo handleUploadError('Invalid file.');
244 244
         return false;
245 245
     }
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
     // Validate against a list of allowed extensions
248 248
     $allowed_extensions = explode(
249 249
         ',',
250
-        $SETTINGS['upload_docext'] . ',' . $SETTINGS['upload_imagesext'] .
251
-            ',' . $SETTINGS['upload_pkgext'] . ',' . $SETTINGS['upload_otherext']
250
+        $SETTINGS['upload_docext'].','.$SETTINGS['upload_imagesext'].
251
+            ','.$SETTINGS['upload_pkgext'].','.$SETTINGS['upload_otherext']
252 252
     );
253 253
 
254 254
     // Check if we should enforce extensions
@@ -271,25 +271,25 @@  discard block
 block discarded – undo
271 271
 
272 272
 // is destination folder writable
273 273
 if (is_writable($SETTINGS['path_to_files_folder']) === false) {
274
-    echo handleUploadError('Not enough permissions on folder ' . $SETTINGS['path_to_files_folder'] . '.');
274
+    echo handleUploadError('Not enough permissions on folder '.$SETTINGS['path_to_files_folder'].'.');
275 275
     return false;
276 276
 }
277 277
 
278 278
 // Make sure the fileName is unique but only if chunking is disabled
279
-if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
279
+if ($chunks < 2 && file_exists($targetDir.DIRECTORY_SEPARATOR.$fileName)) {
280 280
     // $ext is guaranteed to be a string due to prior checks
281 281
     $fileNameA = substr($fileName, 0, strlen(/** @scrutinizer ignore-type */$ext));
282 282
     $fileNameB = substr($fileName, strlen(/** @scrutinizer ignore-type */$ext));
283 283
 
284 284
     $count = 1;
285
-    while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileNameA . '_' . $count . $fileNameB)) {
285
+    while (file_exists($targetDir.DIRECTORY_SEPARATOR.$fileNameA.'_'.$count.$fileNameB)) {
286 286
         ++$count;
287 287
     }
288 288
 
289
-    $fileName = $fileNameA . '_' . $count . $fileNameB;
289
+    $fileName = $fileNameA.'_'.$count.$fileNameB;
290 290
 }
291 291
 
292
-$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName;
292
+$filePath = $targetDir.DIRECTORY_SEPARATOR.$fileName;
293 293
 
294 294
 // Create target dir
295 295
 if (!file_exists($targetDir)) {
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 // Remove old temp files
304 304
 if ($cleanupTargetDir && is_dir($targetDir) && ($dir = opendir($targetDir))) {
305 305
     while (($fileClean = readdir($dir)) !== false) {
306
-        $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $fileClean;
306
+        $tmpfilePath = $targetDir.DIRECTORY_SEPARATOR.$fileClean;
307 307
 
308 308
         // Remove temp file if it is older than the max age and is not the current file
309 309
         if (
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 
318 318
     closedir($dir);
319 319
 } else {
320
-    echo handleUploadError('Not enough permissions on folder ' . $SETTINGS['path_to_files_folder'] . '.');
320
+    echo handleUploadError('Not enough permissions on folder '.$SETTINGS['path_to_files_folder'].'.');
321 321
     return false;
322 322
 }
323 323
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 
354 354
                 // Safe destination folder
355 355
                 $uploadDir = realpath($SETTINGS['path_to_upload_folder']);
356
-                $destinationPath = $uploadDir . DIRECTORY_SEPARATOR . $fileName;
356
+                $destinationPath = $uploadDir.DIRECTORY_SEPARATOR.$fileName;
357 357
                 
358 358
                 if (move_uploaded_file($tmpFilePath, $destinationPath)) {
359 359
                     // Open the moved file in read mode
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             return false;
395 395
         }
396 396
     } else {
397
-        echo handleUploadError('Failed to move uploaded file to ' . $SETTINGS['path_to_files_folder'] . '.');
397
+        echo handleUploadError('Failed to move uploaded file to '.$SETTINGS['path_to_files_folder'].'.');
398 398
         return false;
399 399
     }
400 400
 } else {
@@ -410,14 +410,14 @@  discard block
 block discarded – undo
410 410
                 fwrite($out, $buff);
411 411
             }
412 412
         } else {
413
-            echo handleUploadError('Failed to open input stream ' . $SETTINGS['path_to_files_folder'] . '.');
413
+            echo handleUploadError('Failed to open input stream '.$SETTINGS['path_to_files_folder'].'.');
414 414
             return false;
415 415
         }
416 416
 
417 417
         fclose($in);
418 418
         fclose($out);
419 419
     } else {
420
-        echo handleUploadError('Failed to open output stream ' . $SETTINGS['path_to_files_folder'] . '.');
420
+        echo handleUploadError('Failed to open output stream '.$SETTINGS['path_to_files_folder'].'.');
421 421
         return false;
422 422
     }
423 423
 }
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 ) {
451 451
     rename(
452 452
         $filePath,
453
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName
453
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName
454 454
     );
455 455
 
456 456
     // Add in DB
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 ) {
480 480
     rename(
481 481
         $filePath,
482
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName
482
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName
483 483
     );
484 484
 
485 485
     // Add in DB
@@ -512,13 +512,13 @@  discard block
 block discarded – undo
512 512
     // rename the file
513 513
     rename(
514 514
         $filePath,
515
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName . '.' . $ext
515
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName.'.'.$ext
516 516
     );
517 517
 
518 518
     // make thumbnail
519 519
     $ret = makeThumbnail(
520
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName . '.' . $ext,
521
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName . '_thumb' . '.' . $ext,
520
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName.'.'.$ext,
521
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName.'_thumb'.'.'.$ext,
522 522
         40
523 523
     );
524 524
 
@@ -530,21 +530,21 @@  discard block
 block discarded – undo
530 530
     }
531 531
 
532 532
     // get current avatar and delete it
533
-    $data = DB::queryFirstRow('SELECT avatar, avatar_thumb FROM ' . prefixTable('users') . ' WHERE id=%i', $session->get('user-id'));
534
-    fileDelete($targetDir . DIRECTORY_SEPARATOR . $data['avatar'], $SETTINGS);
535
-    fileDelete($targetDir . DIRECTORY_SEPARATOR . $data['avatar_thumb'], $SETTINGS);
533
+    $data = DB::queryFirstRow('SELECT avatar, avatar_thumb FROM '.prefixTable('users').' WHERE id=%i', $session->get('user-id'));
534
+    fileDelete($targetDir.DIRECTORY_SEPARATOR.$data['avatar'], $SETTINGS);
535
+    fileDelete($targetDir.DIRECTORY_SEPARATOR.$data['avatar_thumb'], $SETTINGS);
536 536
 
537 537
     // store in DB the new avatar
538 538
     DB::query(
539
-        'UPDATE ' . prefixTable('users') . "
540
-        SET avatar='" . $newFileName . '.' . $ext . "', avatar_thumb='" . $newFileName . '_thumb' . '.' . $ext . "'
539
+        'UPDATE '.prefixTable('users')."
540
+        SET avatar='" . $newFileName.'.'.$ext."', avatar_thumb='".$newFileName.'_thumb'.'.'.$ext."'
541 541
         WHERE id=%i",
542 542
         $session->get('user-id')
543 543
     );
544 544
 
545 545
     // store in session
546
-    $session->set('user-avatar', $newFileName . '.' . $ext);
547
-    $session->set('user-avatar_thumb', $newFileName . '_thumb' . '.' . $ext);
546
+    $session->set('user-avatar', $newFileName.'.'.$ext);
547
+    $session->set('user-avatar_thumb', $newFileName.'_thumb'.'.'.$ext);
548 548
 
549 549
     // return info
550 550
     echo prepareExchangedData(
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 ) {
564 564
     rename(
565 565
         $filePath,
566
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName
566
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName
567 567
     );
568 568
 
569 569
     // Add in DB
Please login to merge, or discard this patch.
sources/admin.queries.php 1 patch
Spacing   +135 added lines, -135 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) {
73 73
     // Not allowed page
74 74
     $session->set('system-error_code', ERR_NOT_ALLOWED);
75
-    include $SETTINGS['cpassman_dir'] . '/error.php';
75
+    include $SETTINGS['cpassman_dir'].'/error.php';
76 76
     exit;
77 77
 }
78 78
 
@@ -133,14 +133,14 @@  discard block
 block discarded – undo
133 133
             break;
134 134
         }
135 135
 
136
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
136
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
137 137
         $return = '';
138 138
 
139 139
         //Get all tables
140 140
         $tables = array();
141 141
         $result = DB::query('SHOW TABLES');
142 142
         foreach ($result as $row) {
143
-            $tables[] = $row['Tables_in_' . DB_NAME];
143
+            $tables[] = $row['Tables_in_'.DB_NAME];
144 144
         }
145 145
 
146 146
         //cycle through
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             if (defined('DB_PREFIX') || substr_count($table, DB_PREFIX) > 0) {
149 149
                 $table = (is_string($table) ? $table : strval($table));
150 150
                 // Do query
151
-                $result = DB::query('SELECT * FROM ' . $table);
151
+                $result = DB::query('SELECT * FROM '.$table);
152 152
                 DB::query(
153 153
                     'SELECT *
154 154
                     FROM INFORMATION_SCHEMA.COLUMNS
@@ -160,20 +160,20 @@  discard block
 block discarded – undo
160 160
                 $numFields = DB::count();
161 161
 
162 162
                 // prepare a drop table
163
-                $return .= 'DROP TABLE ' . $table . ';';
164
-                $row2 = DB::queryFirstRow('SHOW CREATE TABLE ' . $table);
165
-                $return .= "\n\n" . strval($row2['Create Table']) . ";\n\n";
163
+                $return .= 'DROP TABLE '.$table.';';
164
+                $row2 = DB::queryFirstRow('SHOW CREATE TABLE '.$table);
165
+                $return .= "\n\n".strval($row2['Create Table']).";\n\n";
166 166
 
167 167
                 //prepare all fields and datas
168 168
                 for ($i = 0; $i < $numFields; ++$i) {
169 169
                     if (is_object($result)) {
170 170
                         while ($row = $result->fetch_row()) {
171
-                            $return .= 'INSERT INTO ' . $table . ' VALUES(';
171
+                            $return .= 'INSERT INTO '.$table.' VALUES(';
172 172
                             for ($j = 0; $j < $numFields; ++$j) {
173 173
                                 $row[$j] = addslashes($row[$j]);
174 174
                                 $row[$j] = preg_replace("/\n/", '\\n', $row[$j]);
175 175
                                 if (isset($row[$j])) {
176
-                                    $return .= '"' . $row[$j] . '"';
176
+                                    $return .= '"'.$row[$j].'"';
177 177
                                 } else {
178 178
                                     $return .= 'NULL';
179 179
                                 }
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
             $token = GenerateCryptKey(20, false, true, true, false, true);
195 195
 
196 196
             //save file
197
-            $filename = time() . '-' . $token . '.sql';
198
-            $handle = fopen($SETTINGS['path_to_files_folder'] . '/' . $filename, 'w+');
197
+            $filename = time().'-'.$token.'.sql';
198
+            $handle = fopen($SETTINGS['path_to_files_folder'].'/'.$filename, 'w+');
199 199
             if ($handle !== false) {
200 200
                 //write file
201 201
                 fwrite($handle, $return);
@@ -207,16 +207,16 @@  discard block
 block discarded – undo
207 207
                 // Encrypt the file
208 208
                 prepareFileWithDefuse(
209 209
                     'encrypt',
210
-                    $SETTINGS['path_to_files_folder'] . '/' . $filename,
211
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
210
+                    $SETTINGS['path_to_files_folder'].'/'.$filename,
211
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
212 212
                     $post_option
213 213
                 );
214 214
 
215 215
                 // Do clean
216
-                unlink($SETTINGS['path_to_files_folder'] . '/' . $filename);
216
+                unlink($SETTINGS['path_to_files_folder'].'/'.$filename);
217 217
                 rename(
218
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
219
-                    $SETTINGS['path_to_files_folder'] . '/' . $filename
218
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
219
+                    $SETTINGS['path_to_files_folder'].'/'.$filename
220 220
                 );
221 221
             }
222 222
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             //update LOG
227 227
             logEvents($SETTINGS, 'admin_action', 'dataBase backup', (string) $session->get('user-id'), $session->get('user-login'));
228 228
 
229
-            echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name=' . urlencode($filename) . '&sub=files&file=' . $filename . '&type=sql&key=' . $session->get('key') . '&key_tmp=' . $session->get('user-key_tmp') . '&pathIsFiles=1"}]';
229
+            echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name='.urlencode($filename).'&sub=files&file='.$filename.'&type=sql&key='.$session->get('key').'&key_tmp='.$session->get('user-key_tmp').'&pathIsFiles=1"}]';
230 230
         }
231 231
         break;
232 232
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             );
256 256
             break;
257 257
         }
258
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
258
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
259 259
 
260 260
         $dataPost = explode('&', $post_option);
261 261
         $file = htmlspecialchars($dataPost[0]);
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         // Get filename from database
265 265
         $data = DB::queryFirstRow(
266 266
             'SELECT valeur
267
-            FROM ' . prefixTable('misc') . '
267
+            FROM ' . prefixTable('misc').'
268 268
             WHERE increment_id = %i',
269 269
             $file
270 270
         );
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
             // Decrypt the file
284 284
             $ret = prepareFileWithDefuse(
285 285
                 'decrypt',
286
-                $SETTINGS['path_to_files_folder'] . '/' . $file,
287
-                $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file,
286
+                $SETTINGS['path_to_files_folder'].'/'.$file,
287
+                $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file,
288 288
                 $key
289 289
             );
290 290
 
@@ -295,10 +295,10 @@  discard block
 block discarded – undo
295 295
             }
296 296
 
297 297
             // Do clean
298
-            fileDelete($SETTINGS['path_to_files_folder'] . '/' . $file, $SETTINGS);
299
-            $file = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file;
298
+            fileDelete($SETTINGS['path_to_files_folder'].'/'.$file, $SETTINGS);
299
+            $file = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file;
300 300
         } else {
301
-            $file = $SETTINGS['path_to_files_folder'] . '/' . $file;
301
+            $file = $SETTINGS['path_to_files_folder'].'/'.$file;
302 302
         }
303 303
 
304 304
         //read sql file
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         fclose($handle);
316 316
 
317 317
         //delete file
318
-        unlink($SETTINGS['path_to_files_folder'] . '/' . $file);
318
+        unlink($SETTINGS['path_to_files_folder'].'/'.$file);
319 319
 
320 320
         //Show done
321 321
         echo '[{"result":"db_restore" , "message":""}]';
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
                 $tablename = (is_string($tablename) ? $tablename : strval($tablename));
355 355
                 if (substr_count($tablename, DB_PREFIX) > 0) {
356 356
                     // launch optimization quieries
357
-                    DB::query('ANALYZE TABLE `' . $tablename . '`');
358
-                    DB::query('OPTIMIZE TABLE `' . $tablename . '`');
357
+                    DB::query('ANALYZE TABLE `'.$tablename.'`');
358
+                    DB::query('OPTIMIZE TABLE `'.$tablename.'`');
359 359
                 }
360 360
             }
361 361
         }
@@ -363,12 +363,12 @@  discard block
 block discarded – undo
363 363
         //Clean up LOG_ITEMS table
364 364
         $rows = DB::query(
365 365
             'SELECT id
366
-            FROM ' . prefixTable('items') . '
366
+            FROM ' . prefixTable('items').'
367 367
             ORDER BY id ASC'
368 368
         );
369 369
         foreach ($rows as $item) {
370 370
             DB::query(
371
-                'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s',
371
+                'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s',
372 372
                 $item['id'],
373 373
                 'at_creation'
374 374
             );
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             if ($counter === 0) {
377 377
                 //Create new at_creation entry
378 378
                 $rowTmp = DB::queryFirstRow(
379
-                    'SELECT date, id_user FROM ' . prefixTable('log_items') . ' WHERE id_item=%i ORDER BY date ASC',
379
+                    'SELECT date, id_user FROM '.prefixTable('log_items').' WHERE id_item=%i ORDER BY date ASC',
380 380
                     $item['id']
381 381
                 );
382 382
                 DB::insert(
@@ -406,8 +406,8 @@  discard block
 block discarded – undo
406 406
         echo prepareExchangedData(
407 407
             array(
408 408
                 'error' => false,
409
-                'message' => $lang->get('last_execution') . ' ' .
410
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
409
+                'message' => $lang->get('last_execution').' '.
410
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
411 411
                     '<i class="fas fa-check text-success ml-2"></i>',
412 412
             ),
413 413
             'encode'
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
             break;
444 444
         }
445 445
 
446
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
446
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
447 447
         updateCacheTable('reload', NULL);
448 448
 
449 449
         // Log
@@ -459,8 +459,8 @@  discard block
 block discarded – undo
459 459
         echo prepareExchangedData(
460 460
             [
461 461
                 'error' => false,
462
-                'message' => $lang->get('last_execution') . ' ' .
463
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
462
+                'message' => $lang->get('last_execution').' '.
463
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
464 464
                     '<i class="fas fa-check text-success mr-2"></i>',
465 465
             ],
466 466
             'encode'
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
         $session->set('user-reencrypt_old_salt', file_get_contents(SECUREPATH.'/'.SECUREFILE));
503 503
 
504 504
         // generate new saltkey
505
-        $old_sk_filename = SECUREPATH.'/'.SECUREFILE . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))) . '.' . time();
505
+        $old_sk_filename = SECUREPATH.'/'.SECUREFILE.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).'.'.time();
506 506
         copy(
507 507
             SECUREPATH.'/'.SECUREFILE,
508 508
             $old_sk_filename
@@ -531,13 +531,13 @@  discard block
 block discarded – undo
531 531
         logEvents($SETTINGS, 'system', 'change_salt_key', (string) $session->get('user-id'), $session->get('user-login'));
532 532
 
533 533
         // get number of items to change
534
-        DB::query('SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', 0);
534
+        DB::query('SELECT id FROM '.prefixTable('items').' WHERE perso = %i', 0);
535 535
         $nb_of_items = DB::count();
536 536
 
537 537
         // create backup table
538
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
538
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
539 539
         DB::query(
540
-            'CREATE TABLE `' . prefixTable('sk_reencrypt_backup') . '` (
540
+            'CREATE TABLE `'.prefixTable('sk_reencrypt_backup').'` (
541 541
             `id` int(12) NOT null AUTO_INCREMENT,
542 542
             `current_table` varchar(100) NOT NULL,
543 543
             `current_field` varchar(500) NOT NULL,
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
         );
566 566
 
567 567
         // delete previous backup files
568
-        $files = glob($SETTINGS['path_to_upload_folder'] . '/*'); // get all file names
568
+        $files = glob($SETTINGS['path_to_upload_folder'].'/*'); // get all file names
569 569
         foreach ($files as $file) { // iterate files
570 570
             if (is_file($file)) {
571 571
                 $file_parts = pathinfo($file);
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
                 echo prepareExchangedData(
653 653
                     array(
654 654
                         'error' => true,
655
-                        'message' => 'Input `' . $objects[0] . '` is not allowed',
655
+                        'message' => 'Input `'.$objects[0].'` is not allowed',
656 656
                         'nbOfItems' => '',
657 657
                         'nextAction' => '',
658 658
                     ),
@@ -665,9 +665,9 @@  discard block
 block discarded – undo
665 665
                 //change all encrypted data in Items (passwords)
666 666
                 $rows = DB::query(
667 667
                     'SELECT id, pw, pw_iv
668
-                    FROM ' . prefixTable('items') . '
668
+                    FROM ' . prefixTable('items').'
669 669
                     WHERE perso = %s
670
-                    LIMIT ' . $post_start . ', ' . $post_length,
670
+                    LIMIT ' . $post_start.', '.$post_length,
671 671
                     '0'
672 672
                 );
673 673
                 foreach ($rows as $record) {
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
                             'current_field' => 'pw',
680 680
                             'value_id' => $record['id'],
681 681
                             'value' => $record['pw'],
682
-                            'current_sql' => 'UPDATE ' . prefixTable('items') . " SET pw = '" . $record['pw'] . "' WHERE id = '" . $record['id'] . "';",
682
+                            'current_sql' => 'UPDATE '.prefixTable('items')." SET pw = '".$record['pw']."' WHERE id = '".$record['id']."';",
683 683
                             'value2' => 'none',
684 684
                             'result' => 'none',
685 685
                         )
@@ -728,9 +728,9 @@  discard block
 block discarded – undo
728 728
                 //change all encrypted data in Logs (passwords)
729 729
                 $rows = DB::query(
730 730
                     'SELECT raison, increment_id
731
-                    FROM ' . prefixTable('log_items') . "
731
+                    FROM ' . prefixTable('log_items')."
732 732
                     WHERE action = %s AND raison LIKE 'at_pw :%'
733
-                    LIMIT " . $post_start . ', ' . $post_length,
733
+                    LIMIT " . $post_start.', '.$post_length,
734 734
                     'at_modification'
735 735
                 );
736 736
                 foreach ($rows as $record) {
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
                             'current_field' => 'raison',
743 743
                             'value_id' => $record['increment_id'],
744 744
                             'value' => $record['raison'],
745
-                            'current_sql' => 'UPDATE ' . prefixTable('log_items') . " SET raison = '" . $record['raison'] . "' WHERE increment_id = '" . $record['increment_id'] . "';",
745
+                            'current_sql' => 'UPDATE '.prefixTable('log_items')." SET raison = '".$record['raison']."' WHERE increment_id = '".$record['increment_id']."';",
746 746
                             'value2' => 'none',
747 747
                             'result' => 'none',
748 748
                         )
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
                         DB::update(
771 771
                             prefixTable('log_items'),
772 772
                             array(
773
-                                'raison' => 'at_pw :' . $encrypt['string'],
773
+                                'raison' => 'at_pw :'.$encrypt['string'],
774 774
                                 'encryption_type' => 'defuse',
775 775
                             ),
776 776
                             'increment_id = %i',
@@ -795,8 +795,8 @@  discard block
 block discarded – undo
795 795
                 //change all encrypted data in CATEGORIES (passwords)
796 796
                 $rows = DB::query(
797 797
                     'SELECT id, data
798
-                    FROM ' . prefixTable('categories_items') . '
799
-                    LIMIT ' . $post_start . ', ' . $post_length
798
+                    FROM ' . prefixTable('categories_items').'
799
+                    LIMIT ' . $post_start.', '.$post_length
800 800
                 );
801 801
                 foreach ($rows as $record) {
802 802
                     // backup data
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
                             'current_field' => 'data',
808 808
                             'value_id' => $record['id'],
809 809
                             'value' => $record['data'],
810
-                            'current_sql' => 'UPDATE ' . prefixTable('categories_items') . " SET data = '" . $record['data'] . "' WHERE id = '" . $record['id'] . "';",
810
+                            'current_sql' => 'UPDATE '.prefixTable('categories_items')." SET data = '".$record['data']."' WHERE id = '".$record['id']."';",
811 811
                             'value2' => 'none',
812 812
                             'result' => 'none',
813 813
                         )
@@ -855,9 +855,9 @@  discard block
 block discarded – undo
855 855
                 // Change all encrypted data in FILES (passwords)
856 856
                 $rows = DB::query(
857 857
                     'SELECT id, file, status
858
-                    FROM ' . prefixTable('files') . "
858
+                    FROM ' . prefixTable('files')."
859 859
                     WHERE status = 'encrypted'
860
-                    LIMIT " . $post_start . ', ' . $post_length
860
+                    LIMIT " . $post_start.', '.$post_length
861 861
                 );
862 862
                 foreach ($rows as $record) {
863 863
                     // backup data
@@ -875,20 +875,20 @@  discard block
 block discarded – undo
875 875
                     );
876 876
                     $newID = DB::insertId();
877 877
 
878
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) {
878
+                    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
879 879
                         // make a copy of file
880 880
                         if (!copy(
881
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
882
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '.copy'
881
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
882
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'.copy'
883 883
                         )) {
884 884
                             $error = 'Copy not possible';
885 885
                             exit;
886 886
                         } else {
887 887
                             // prepare a bck of file (that will not be deleted)
888
-                            $backup_filename = $record['file'] . '.bck-change-sk.' . time();
888
+                            $backup_filename = $record['file'].'.bck-change-sk.'.time();
889 889
                             copy(
890
-                                $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
891
-                                $SETTINGS['path_to_upload_folder'] . '/' . $backup_filename
890
+                                $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
891
+                                $SETTINGS['path_to_upload_folder'].'/'.$backup_filename
892 892
                             );
893 893
                         }
894 894
 
@@ -896,22 +896,22 @@  discard block
 block discarded – undo
896 896
                         // STEP1 - Do decryption
897 897
                         prepareFileWithDefuse(
898 898
                             'decrypt',
899
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
900
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted'
899
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
900
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted'
901 901
                         );
902 902
 
903 903
                         // Do cleanup of files
904
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file']);
904
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file']);
905 905
 
906 906
                         // STEP2 - Do encryption
907 907
                         prepareFileWithDefuse(
908 908
                             'encryp',
909
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted',
910
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file']
909
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted',
910
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file']
911 911
                         );
912 912
 
913 913
                         // Do cleanup of files
914
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted');
914
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted');
915 915
 
916 916
                         // Update backup table
917 917
                         DB::update(
@@ -937,13 +937,13 @@  discard block
 block discarded – undo
937 937
                 // do some things for new object
938 938
                 if (isset($objects[0])) {
939 939
                     if ($objects[0] === 'logs') {
940
-                        DB::query('SELECT increment_id FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
940
+                        DB::query('SELECT increment_id FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
941 941
                     } elseif ($objects[0] === 'files') {
942
-                        DB::query('SELECT id FROM ' . prefixTable('files'));
942
+                        DB::query('SELECT id FROM '.prefixTable('files'));
943 943
                     } elseif ($objects[0] === 'categories') {
944
-                        DB::query('SELECT id FROM ' . prefixTable('categories_items'));
944
+                        DB::query('SELECT id FROM '.prefixTable('categories_items'));
945 945
                     } elseif ($objects[0] === 'custfields') {
946
-                        DB::query('SELECT raison FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
946
+                        DB::query('SELECT raison FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
947 947
                     }
948 948
                     $nb_of_items = DB::count();
949 949
                 } else {
@@ -1063,12 +1063,12 @@  discard block
 block discarded – undo
1063 1063
                 );
1064 1064
             } elseif ($record['current_table'] === 'files') {
1065 1065
                 // restore backup file
1066
-                if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value'])) {
1067
-                    unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value']);
1068
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) {
1066
+                if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value'])) {
1067
+                    unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value']);
1068
+                    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) {
1069 1069
                         rename(
1070
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['value2'],
1071
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['value']
1070
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['value2'],
1071
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['value']
1072 1072
                         );
1073 1073
                     }
1074 1074
                 }
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
         }
1088 1088
 
1089 1089
         // drop table
1090
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1090
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1091 1091
 
1092 1092
         // Send back
1093 1093
         echo prepareExchangedData(
@@ -1130,17 +1130,17 @@  discard block
 block discarded – undo
1130 1130
         // delete files
1131 1131
         $rows = DB::query(
1132 1132
             'SELECT value, value2
1133
-            FROM ' . prefixTable('sk_reencrypt_backup') . "
1133
+            FROM ' . prefixTable('sk_reencrypt_backup')."
1134 1134
             WHERE current_table = 'files'"
1135 1135
         );
1136 1136
         foreach ($rows as $record) {
1137
-            if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) {
1138
-                unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value2']);
1137
+            if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) {
1138
+                unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value2']);
1139 1139
             }
1140 1140
         }
1141 1141
 
1142 1142
         // drop table
1143
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1143
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1144 1144
 
1145 1145
         echo '[{"status":"done"}]';
1146 1146
         break;
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
                 'encode'
1172 1172
             );
1173 1173
         } else {
1174
-            require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1174
+            require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1175 1175
 
1176 1176
             //send email
1177 1177
             $emailSettings = new EmailSettings($SETTINGS);
@@ -1209,13 +1209,13 @@  discard block
 block discarded – undo
1209 1209
             break;
1210 1210
         }
1211 1211
 
1212
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1212
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1213 1213
         $emailSettings = new EmailSettings($SETTINGS);
1214 1214
         $emailService = new EmailService();
1215 1215
 
1216 1216
         $rows = DB::query(
1217 1217
             'SELECT *
1218
-            FROM ' . prefixTable('emails') . '
1218
+            FROM ' . prefixTable('emails').'
1219 1219
             WHERE status = %s OR status = %s',
1220 1220
             'not_sent',
1221 1221
             ''
@@ -1301,13 +1301,13 @@  discard block
 block discarded – undo
1301 1301
             break;
1302 1302
         }
1303 1303
 
1304
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1304
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1305 1305
 
1306 1306
         // Instatiate email settings and service
1307 1307
         $emailSettings = new EmailSettings($SETTINGS);
1308 1308
         $emailService = new EmailService();
1309 1309
 
1310
-        $rows = DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', '');
1310
+        $rows = DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', '');
1311 1311
         foreach ($rows as $record) {
1312 1312
             //send email
1313 1313
             $email = $emailService->sendMail(
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
             break;
1377 1377
         }
1378 1378
 
1379
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1379
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1380 1380
 
1381 1381
         // init
1382 1382
         $filesList = array();
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
                 FROM ' . prefixTable('files')
1390 1390
             );
1391 1391
             foreach ($rows as $record) {
1392
-                if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) {
1392
+                if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
1393 1393
                     $addFile = false;
1394 1394
                     if (($post_option === 'attachments-decrypt' && $record['status'] === 'encrypted')
1395 1395
                         || ($post_option === 'attachments-encrypt' && $record['status'] === 'clear')
@@ -1454,8 +1454,8 @@  discard block
 block discarded – undo
1454 1454
         $post_list = filter_var_array($post_list, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
1455 1455
         $post_counter = filter_var($post_counter, FILTER_SANITIZE_NUMBER_INT);
1456 1456
 
1457
-        include $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1458
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1457
+        include $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1458
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1459 1459
 
1460 1460
         $cpt = 0;
1461 1461
         $continu = true;
@@ -1468,33 +1468,33 @@  discard block
 block discarded – undo
1468 1468
                 // Get file name
1469 1469
                 $file_info = DB::queryFirstRow(
1470 1470
                     'SELECT file
1471
-                    FROM ' . prefixTable('files') . '
1471
+                    FROM ' . prefixTable('files').'
1472 1472
                     WHERE id = %i',
1473 1473
                     $file
1474 1474
                 );
1475 1475
 
1476 1476
                 // skip file is Coherancey not respected
1477
-                if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'])) {
1477
+                if (is_file($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'])) {
1478 1478
                     // Case where we want to decrypt
1479 1479
                     if ($post_option === 'decrypt') {
1480 1480
                         prepareFileWithDefuse(
1481 1481
                             'decrypt',
1482
-                            $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'],
1483
-                            $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1482
+                            $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'],
1483
+                            $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1484 1484
                         );
1485 1485
                         // Case where we want to encrypt
1486 1486
                     } elseif ($post_option === 'encrypt') {
1487 1487
                         prepareFileWithDefuse(
1488 1488
                             'encrypt',
1489
-                            $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'],
1490
-                            $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1489
+                            $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'],
1490
+                            $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1491 1491
                         );
1492 1492
                     }
1493 1493
                     // Do file cleanup
1494
-                    fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], $SETTINGS);
1494
+                    fileDelete($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], $SETTINGS);
1495 1495
                     rename(
1496
-                        $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1497
-                        $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file']
1496
+                        $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1497
+                        $SETTINGS['path_to_upload_folder'].'/'.$file_info['file']
1498 1498
                     );
1499 1499
 
1500 1500
                     // store in DB
@@ -1529,8 +1529,8 @@  discard block
 block discarded – undo
1529 1529
                 $post_option === 'attachments-decrypt' ? 'clear' : 'encrypted'
1530 1530
             );
1531 1531
 
1532
-            $message = $lang->get('last_execution') . ' ' .
1533
-                date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
1532
+            $message = $lang->get('last_execution').' '.
1533
+                date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
1534 1534
                 '<i class="fas fa-check text-success ml-2 mr-3"></i>';
1535 1535
         }
1536 1536
 
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
             $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_NUMBER_INT);
1625 1625
 
1626 1626
             DB::query(
1627
-                'DELETE FROM ' . prefixTable('api') . ' WHERE increment_id = %i',
1627
+                'DELETE FROM '.prefixTable('api').' WHERE increment_id = %i',
1628 1628
                 $post_id
1629 1629
             );
1630 1630
         }
@@ -1719,7 +1719,7 @@  discard block
 block discarded – undo
1719 1719
             // Delete existing key
1720 1720
         } elseif (null !== $post_action && $post_action === 'delete') {
1721 1721
             $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
1722
-            DB::query('DELETE FROM ' . prefixTable('api') . ' WHERE increment_id=%i', $post_id);
1722
+            DB::query('DELETE FROM '.prefixTable('api').' WHERE increment_id=%i', $post_id);
1723 1723
         }
1724 1724
 
1725 1725
         echo prepareExchangedData(
@@ -1734,7 +1734,7 @@  discard block
 block discarded – undo
1734 1734
 
1735 1735
     case 'save_api_status':
1736 1736
         // Do query
1737
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'api');
1737
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'api');
1738 1738
         $counter = DB::count();
1739 1739
         if ($counter === 0) {
1740 1740
             DB::insert(
@@ -1763,7 +1763,7 @@  discard block
 block discarded – undo
1763 1763
 
1764 1764
     case 'run_duo_config_check':
1765 1765
         //Libraries call
1766
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1766
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1767 1767
         // Check KEY
1768 1768
         if ($post_key !== $session->get('key')) {
1769 1769
             echo prepareExchangedData(
@@ -1869,7 +1869,7 @@  discard block
 block discarded – undo
1869 1869
         } else {
1870 1870
             $tmp = 1;
1871 1871
         }
1872
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication');
1872
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication');
1873 1873
         $counter = DB::count();
1874 1874
         if ($counter === 0) {
1875 1875
             DB::insert(
@@ -1897,7 +1897,7 @@  discard block
 block discarded – undo
1897 1897
 
1898 1898
         // ga_website_name
1899 1899
         if (is_null($dataReceived['ga_website_name']) === false) {
1900
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name');
1900
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name');
1901 1901
             $counter = DB::count();
1902 1902
             if ($counter === 0) {
1903 1903
                 DB::insert(
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
         }
1928 1928
 
1929 1929
         // send data
1930
-        echo '[{"result" : "' . addslashes($lang['done']) . '" , "error" : ""}]';
1930
+        echo '[{"result" : "'.addslashes($lang['done']).'" , "error" : ""}]';
1931 1931
         break;
1932 1932
 
1933 1933
     case 'save_agses_options':
@@ -1950,7 +1950,7 @@  discard block
 block discarded – undo
1950 1950
 
1951 1951
         // agses_hosted_url
1952 1952
         if (!is_null($dataReceived['agses_hosted_url'])) {
1953
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url');
1953
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url');
1954 1954
             $counter = DB::count();
1955 1955
             if ($counter === 0) {
1956 1956
                 DB::insert(
@@ -1981,7 +1981,7 @@  discard block
 block discarded – undo
1981 1981
 
1982 1982
         // agses_hosted_id
1983 1983
         if (!is_null($dataReceived['agses_hosted_id'])) {
1984
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id');
1984
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id');
1985 1985
             $counter = DB::count();
1986 1986
             if ($counter === 0) {
1987 1987
                 DB::insert(
@@ -2012,7 +2012,7 @@  discard block
 block discarded – undo
2012 2012
 
2013 2013
         // agses_hosted_apikey
2014 2014
         if (!is_null($dataReceived['agses_hosted_apikey'])) {
2015
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey');
2015
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey');
2016 2016
             $counter = DB::count();
2017 2017
             if ($counter === 0) {
2018 2018
                 DB::insert(
@@ -2042,7 +2042,7 @@  discard block
 block discarded – undo
2042 2042
         }
2043 2043
 
2044 2044
         // send data
2045
-        echo '[{"result" : "' . addslashes($lang['done']) . '" , "error" : ""}]';
2045
+        echo '[{"result" : "'.addslashes($lang['done']).'" , "error" : ""}]';
2046 2046
         break;
2047 2047
 
2048 2048
     case 'save_option_change':
@@ -2083,7 +2083,7 @@  discard block
 block discarded – undo
2083 2083
 
2084 2084
         // Check if setting is already in DB. If NO then insert, if YES then update.
2085 2085
         $data = DB::query(
2086
-            'SELECT * FROM ' . prefixTable('misc') . '
2086
+            'SELECT * FROM '.prefixTable('misc').'
2087 2087
             WHERE type = %s AND intitule = %s',
2088 2088
             'admin',
2089 2089
             $post_field
@@ -2106,7 +2106,7 @@  discard block
 block discarded – undo
2106 2106
                     array(
2107 2107
                         'valeur' => time(),
2108 2108
                         'type' => 'admin',
2109
-                        'intitule' => $post_field . '_time',
2109
+                        'intitule' => $post_field.'_time',
2110 2110
                         'updated_at' => time(),
2111 2111
                     )
2112 2112
                 );
@@ -2128,10 +2128,10 @@  discard block
 block discarded – undo
2128 2128
             if ($post_field === 'send_stats') {
2129 2129
                 // Check if previous time exists, if not them insert this value in DB
2130 2130
                 DB::query(
2131
-                    'SELECT * FROM ' . prefixTable('misc') . '
2131
+                    'SELECT * FROM '.prefixTable('misc').'
2132 2132
                     WHERE type = %s AND intitule = %s',
2133 2133
                     'admin',
2134
-                    $post_field . '_time'
2134
+                    $post_field.'_time'
2135 2135
                 );
2136 2136
                 $counter = DB::count();
2137 2137
                 if ($counter === 0) {
@@ -2140,7 +2140,7 @@  discard block
 block discarded – undo
2140 2140
                         array(
2141 2141
                             'valeur' => 0,
2142 2142
                             'type' => 'admin',
2143
-                            'intitule' => $post_field . '_time',
2143
+                            'intitule' => $post_field.'_time',
2144 2144
                             'created_at' => time(),
2145 2145
                         )
2146 2146
                     );
@@ -2162,13 +2162,13 @@  discard block
 block discarded – undo
2162 2162
         // special Cases
2163 2163
         if ($post_field === 'cpassman_url') {
2164 2164
             // update also jsUrl for CSFP protection
2165
-            $jsUrl = $post_value . '/includes/libraries/csrfp/js/csrfprotector.js';
2165
+            $jsUrl = $post_value.'/includes/libraries/csrfp/js/csrfprotector.js';
2166 2166
             $csrfp_file = '../includes/libraries/csrfp/libs/csrfp.config.php';
2167 2167
             $data = file_get_contents($csrfp_file);
2168 2168
             $posJsUrl = strpos($data, '"jsUrl" => "');
2169 2169
             $posEndLine = strpos($data, '",', $posJsUrl);
2170 2170
             $line = substr($data, $posJsUrl, ($posEndLine - $posJsUrl + 2));
2171
-            $newdata = str_replace($line, '"jsUrl" => "' . filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . '",', $data);
2171
+            $newdata = str_replace($line, '"jsUrl" => "'.filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS).'",', $data);
2172 2172
             file_put_contents($csrfp_file, $newdata);
2173 2173
         } elseif ($post_field === 'restricted_to_input' && (int) $post_value === 0) {
2174 2174
             DB::update(
@@ -2193,7 +2193,7 @@  discard block
 block discarded – undo
2193 2193
         echo prepareExchangedData(
2194 2194
             array(
2195 2195
                 'error' => false,
2196
-                'misc' => $counter . ' ; ' . $SETTINGS[$post_field],
2196
+                'misc' => $counter.' ; '.$SETTINGS[$post_field],
2197 2197
                 'message' => empty($post_translate) === false ? $lang->get($post_translate) : '',
2198 2198
             ),
2199 2199
             'encode'
@@ -2236,7 +2236,7 @@  discard block
 block discarded – undo
2236 2236
 
2237 2237
         // send statistics
2238 2238
         if (null !== $post_status) {
2239
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_stats');
2239
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_stats');
2240 2240
             $counter = DB::count();
2241 2241
             if ($counter === 0) {
2242 2242
                 DB::insert(
@@ -2267,7 +2267,7 @@  discard block
 block discarded – undo
2267 2267
 
2268 2268
         // send statistics items
2269 2269
         if (null !== $post_list) {
2270
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items');
2270
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items');
2271 2271
             $counter = DB::count();
2272 2272
             if ($counter === 0) {
2273 2273
                 DB::insert(
@@ -2313,7 +2313,7 @@  discard block
 block discarded – undo
2313 2313
             break;
2314 2314
         }
2315 2315
 
2316
-        if (DB::query("SHOW TABLES LIKE '" . prefixTable('sk_reencrypt_backup') . "'")) {
2316
+        if (DB::query("SHOW TABLES LIKE '".prefixTable('sk_reencrypt_backup')."'")) {
2317 2317
             if (DB::count() === 1) {
2318 2318
                 echo 1;
2319 2319
             } else {
@@ -2374,7 +2374,7 @@  discard block
 block discarded – undo
2374 2374
 
2375 2375
         $rows = DB::query(
2376 2376
             'SELECT id, title
2377
-                FROM ' . prefixTable('roles_title') . '
2377
+                FROM ' . prefixTable('roles_title').'
2378 2378
                 ORDER BY title ASC'
2379 2379
         );
2380 2380
         foreach ($rows as $record) {
@@ -2506,7 +2506,7 @@  discard block
 block discarded – undo
2506 2506
 
2507 2507
         $ignoredFiles = DB::queryFirstField(
2508 2508
             'SELECT valeur 
2509
-            FROM ' . prefixTable('misc') . ' 
2509
+            FROM ' . prefixTable('misc').' 
2510 2510
             WHERE type = %s AND intitule = %s',
2511 2511
             'admin',
2512 2512
             'ignored_unknown_files'
@@ -2549,7 +2549,7 @@  discard block
 block discarded – undo
2549 2549
         // Get ignored unknown files
2550 2550
         $existingData = DB::queryFirstRow(
2551 2551
             'SELECT valeur 
2552
-            FROM ' . prefixTable('misc') . ' 
2552
+            FROM ' . prefixTable('misc').' 
2553 2553
             WHERE type = %s AND intitule = %s',
2554 2554
             'admin',
2555 2555
             'ignored_unknown_files'
@@ -2606,7 +2606,7 @@  discard block
 block discarded – undo
2606 2606
         // Get the list of files to delete
2607 2607
         $filesToDelete = DB::queryFirstField(
2608 2608
             'SELECT valeur 
2609
-            FROM ' . prefixTable('misc') . ' 
2609
+            FROM ' . prefixTable('misc').' 
2610 2610
             WHERE type = %s AND intitule = %s',
2611 2611
             'admin',
2612 2612
             'unknown_files'
@@ -2653,7 +2653,7 @@  discard block
 block discarded – undo
2653 2653
     $lang = new Language($session->get('user-language') ?? 'english');
2654 2654
 
2655 2655
     $results = [];
2656
-    $fullPath = __DIR__ . '/../';
2656
+    $fullPath = __DIR__.'/../';
2657 2657
     
2658 2658
     foreach ($files as $file) {
2659 2659
         // Normalize path separators for cross-platform compatibility
@@ -2702,7 +2702,7 @@  discard block
 block discarded – undo
2702 2702
         }
2703 2703
         
2704 2704
         // Try to delete the file
2705
-        $deleteResult = '';//@unlink($normalizedPath);
2705
+        $deleteResult = ''; //@unlink($normalizedPath);
2706 2706
         
2707 2707
         if ($deleteResult) {
2708 2708
             $results[$normalizedPath] = [
@@ -2732,7 +2732,7 @@  discard block
 block discarded – undo
2732 2732
  */
2733 2733
 function filesIntegrityCheck($baseDir): array
2734 2734
 {
2735
-    $referenceFile = __DIR__ . '/../files_reference.txt';
2735
+    $referenceFile = __DIR__.'/../files_reference.txt';
2736 2736
 
2737 2737
     $unknownFiles = findUnknownFiles($baseDir, $referenceFile);
2738 2738
 
@@ -2770,7 +2770,7 @@  discard block
 block discarded – undo
2770 2770
                 $dir,
2771 2771
                 FilesystemIterator::SKIP_DOTS
2772 2772
             ),
2773
-            function ($current, $key, $iterator) {
2773
+            function($current, $key, $iterator) {
2774 2774
                 // Ignore hidden files and folders
2775 2775
                 if ($current->getFilename()[0] === '.') {
2776 2776
                     return false;
@@ -2784,7 +2784,7 @@  discard block
 block discarded – undo
2784 2784
     foreach ($iterator as $file) {
2785 2785
         try {
2786 2786
             if ($file->isFile()) {
2787
-                $relativePath = str_replace($dir . DIRECTORY_SEPARATOR, '', $file->getPathname());
2787
+                $relativePath = str_replace($dir.DIRECTORY_SEPARATOR, '', $file->getPathname());
2788 2788
                 $relativePath = str_replace('\\', '/', $relativePath); // Normalisation Windows/Linux
2789 2789
 
2790 2790
                 // Split relatif path into parts
@@ -2850,7 +2850,7 @@  discard block
 block discarded – undo
2850 2850
     // Get ignored files
2851 2851
     $ignoredFiles = DB::queryFirstField(
2852 2852
         'SELECT valeur 
2853
-        FROM ' . prefixTable('misc') . ' 
2853
+        FROM ' . prefixTable('misc').' 
2854 2854
         WHERE type = %s AND intitule = %s',
2855 2855
         'admin',
2856 2856
         'ignored_unknown_files'
@@ -2869,7 +2869,7 @@  discard block
 block discarded – undo
2869 2869
 function tablesIntegrityCheck(): array
2870 2870
 {
2871 2871
     // Get integrity tables file
2872
-    $integrityTablesFile = TEAMPASS_ROOT_PATH . '/includes/tables_integrity.json';
2872
+    $integrityTablesFile = TEAMPASS_ROOT_PATH.'/includes/tables_integrity.json';
2873 2873
     if (file_exists($integrityTablesFile) === false) {
2874 2874
         return [
2875 2875
             'error' => true,
@@ -2887,7 +2887,7 @@  discard block
 block discarded – undo
2887 2887
     // Get all tables
2888 2888
     $tables = [];
2889 2889
     foreach (DB::queryFirstColumn("SHOW TABLES") as $table) {
2890
-        $tables[] = str_replace(DB_PREFIX, "", $table);;
2890
+        $tables[] = str_replace(DB_PREFIX, "", $table); ;
2891 2891
     }
2892 2892
     // Prepare the integrity check
2893 2893
     $tablesInError = [];
@@ -2953,7 +2953,7 @@  discard block
 block discarded – undo
2953 2953
 
2954 2954
         // Compare hashes
2955 2955
         $expectedHash = $referenceData[$file];
2956
-        $actualHash = md5_file($baseDir . '/' . $file);
2956
+        $actualHash = md5_file($baseDir.'/'.$file);
2957 2957
 
2958 2958
         if ($expectedHash !== $actualHash) {
2959 2959
             $issues[] = "$file (expected: <i>$expectedHash</i>, actual: <i>$actualHash</i>)";
@@ -3006,7 +3006,7 @@  discard block
 block discarded – undo
3006 3006
     foreach ($iterator as $file) {
3007 3007
         if ($file->isFile()) {
3008 3008
             // Build relative path
3009
-            $relativePath = str_replace($dir . DIRECTORY_SEPARATOR, '', $file->getPathname());
3009
+            $relativePath = str_replace($dir.DIRECTORY_SEPARATOR, '', $file->getPathname());
3010 3010
             $relativePath = str_replace('\\', '/', $relativePath); // Normalize for Windows
3011 3011
             // Calculate hash
3012 3012
             $files[$relativePath] = md5_file($file->getPathname());
Please login to merge, or discard this patch.