Passed
Push — master ( 2d150a...a3cfc6 )
by Nils
06:39
created
scripts/background_tasks___worker.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 require_once __DIR__.'/traits/ItemHandlerTrait.php';
33 33
 require_once __DIR__.'/traits/UserHandlerTrait.php';
34 34
 require_once __DIR__.'/traits/EmailTrait.php';
35
-require_once __DIR__ . '/taskLogger.php';
35
+require_once __DIR__.'/taskLogger.php';
36 36
 
37 37
 class TaskWorker {
38 38
     use ItemHandlerTrait;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function execute() {
66 66
         try {
67
-            if (LOG_TASKS=== true) $this->logger->log('Processing task: ' . print_r($this->taskData, true), 'DEBUG');
67
+            if (LOG_TASKS === true) $this->logger->log('Processing task: '.print_r($this->taskData, true), 'DEBUG');
68 68
             // Dispatch selon le type de processus
69 69
             switch ($this->processType) {
70 70
                 case 'item_copy':
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             $arguments = '';
137 137
         }
138 138
 
139
-        if (LOG_TASKS=== true) $this->logger->log('Process: '.$this->processType.' -- '.print_r($arguments, true), 'DEBUG');
139
+        if (LOG_TASKS === true) $this->logger->log('Process: '.$this->processType.' -- '.print_r($arguments, true), 'DEBUG');
140 140
 
141 141
         // Add 'arguments' only if not empty
142 142
         if (!empty($arguments)) {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             'increment_id = %i',
151 151
             $this->taskId
152 152
         );
153
-        if (LOG_TASKS=== true) $this->logger->log('Finishing task: ' . $this->taskId, 'DEBUG');
153
+        if (LOG_TASKS === true) $this->logger->log('Finishing task: '.$this->taskId, 'DEBUG');
154 154
     }
155 155
 
156 156
     /**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             'increment_id = %i',
174 174
             $this->taskId
175 175
         );
176
-        $this->logger->log('Task failure: ' . $e->getMessage(), 'ERROR');
176
+        $this->logger->log('Task failure: '.$e->getMessage(), 'ERROR');
177 177
     }
178 178
 
179 179
     /**
@@ -185,16 +185,16 @@  discard block
 block discarded – undo
185 185
      * @return void
186 186
      */
187 187
     private function processSubTasks($arguments) {
188
-        if (LOG_TASKS=== true) $this->logger->log('processSubTasks: '.print_r($arguments, true), 'DEBUG');
188
+        if (LOG_TASKS === true) $this->logger->log('processSubTasks: '.print_r($arguments, true), 'DEBUG');
189 189
         // Get all subtasks related to this task
190 190
         $subtasks = DB::query(
191
-            'SELECT * FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC',
191
+            'SELECT * FROM '.prefixTable('background_subtasks').' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC',
192 192
             $this->taskId
193 193
         );
194 194
     
195 195
         // Check if there are any subtasks to process
196 196
         if (empty($subtasks)) {
197
-            if (LOG_TASKS=== true) $this->logger->log('No subtask was found for task: ' . $this->taskId, 'DEBUG');
197
+            if (LOG_TASKS === true) $this->logger->log('No subtask was found for task: '.$this->taskId, 'DEBUG');
198 198
             return;
199 199
         }
200 200
     
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                 // Get the subtask data
205 205
                 $subtaskData = json_decode($subtask['task'], true);
206 206
 
207
-                if (LOG_TASKS=== true) $this->logger->log('Processing subtask: ' . $subtaskData['step'], 'DEBUG');
207
+                if (LOG_TASKS === true) $this->logger->log('Processing subtask: '.$subtaskData['step'], 'DEBUG');
208 208
 
209 209
                 // Mark subtask as in progress
210 210
                 DB::update(
@@ -256,13 +256,13 @@  discard block
 block discarded – undo
256 256
                     $subtask['increment_id']
257 257
                 );
258 258
         
259
-                $this->logger->log('processSubTasks : ' . $e->getMessage(), 'ERROR');
259
+                $this->logger->log('processSubTasks : '.$e->getMessage(), 'ERROR');
260 260
             }
261 261
         }
262 262
     
263 263
         // Are all subtasks completed?
264 264
         $remainingSubtasks = DB::queryFirstField(
265
-            'SELECT COUNT(*) FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0',
265
+            'SELECT COUNT(*) FROM '.prefixTable('background_subtasks').' WHERE task_id = %i AND is_in_progress = 0',
266 266
             $this->taskId
267 267
         );
268 268
     
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
     error_log("Usage: php background_tasks___worker.php <task_id> <process_type> [<task_data>]");
279 279
     exit(1);
280 280
 }
281
-$taskId = (int)$argv[1];
281
+$taskId = (int) $argv[1];
282 282
 $processType = $argv[2];
283 283
 $taskData = $argv[3] ?? null;
284 284
 if ($taskData) {
Please login to merge, or discard this patch.
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,7 +64,9 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function execute() {
66 66
         try {
67
-            if (LOG_TASKS=== true) $this->logger->log('Processing task: ' . print_r($this->taskData, true), 'DEBUG');
67
+            if (LOG_TASKS=== true) {
68
+                $this->logger->log('Processing task: ' . print_r($this->taskData, true), 'DEBUG');
69
+            }
68 70
             // Dispatch selon le type de processus
69 71
             switch ($this->processType) {
70 72
                 case 'item_copy':
@@ -136,7 +138,9 @@  discard block
 block discarded – undo
136 138
             $arguments = '';
137 139
         }
138 140
 
139
-        if (LOG_TASKS=== true) $this->logger->log('Process: '.$this->processType.' -- '.print_r($arguments, true), 'DEBUG');
141
+        if (LOG_TASKS=== true) {
142
+            $this->logger->log('Process: '.$this->processType.' -- '.print_r($arguments, true), 'DEBUG');
143
+        }
140 144
 
141 145
         // Add 'arguments' only if not empty
142 146
         if (!empty($arguments)) {
@@ -150,7 +154,9 @@  discard block
 block discarded – undo
150 154
             'increment_id = %i',
151 155
             $this->taskId
152 156
         );
153
-        if (LOG_TASKS=== true) $this->logger->log('Finishing task: ' . $this->taskId, 'DEBUG');
157
+        if (LOG_TASKS=== true) {
158
+            $this->logger->log('Finishing task: ' . $this->taskId, 'DEBUG');
159
+        }
154 160
     }
155 161
 
156 162
     /**
@@ -185,7 +191,9 @@  discard block
 block discarded – undo
185 191
      * @return void
186 192
      */
187 193
     private function processSubTasks($arguments) {
188
-        if (LOG_TASKS=== true) $this->logger->log('processSubTasks: '.print_r($arguments, true), 'DEBUG');
194
+        if (LOG_TASKS=== true) {
195
+            $this->logger->log('processSubTasks: '.print_r($arguments, true), 'DEBUG');
196
+        }
189 197
         // Get all subtasks related to this task
190 198
         $subtasks = DB::query(
191 199
             'SELECT * FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC',
@@ -194,7 +202,9 @@  discard block
 block discarded – undo
194 202
     
195 203
         // Check if there are any subtasks to process
196 204
         if (empty($subtasks)) {
197
-            if (LOG_TASKS=== true) $this->logger->log('No subtask was found for task: ' . $this->taskId, 'DEBUG');
205
+            if (LOG_TASKS=== true) {
206
+                $this->logger->log('No subtask was found for task: ' . $this->taskId, 'DEBUG');
207
+            }
198 208
             return;
199 209
         }
200 210
     
@@ -204,7 +214,9 @@  discard block
 block discarded – undo
204 214
                 // Get the subtask data
205 215
                 $subtaskData = json_decode($subtask['task'], true);
206 216
 
207
-                if (LOG_TASKS=== true) $this->logger->log('Processing subtask: ' . $subtaskData['step'], 'DEBUG');
217
+                if (LOG_TASKS=== true) {
218
+                    $this->logger->log('Processing subtask: ' . $subtaskData['step'], 'DEBUG');
219
+                }
208 220
 
209 221
                 // Mark subtask as in progress
210 222
                 DB::update(
Please login to merge, or discard this patch.
pages/admin.js.php 1 patch
Spacing   +8 added lines, -8 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
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                     // error
174 174
                     toastr.remove();
175 175
                     toastr.error(
176
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
176
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
177 177
                         '', {
178 178
                             closeButton: true,
179 179
                             positionClass: 'toast-bottom-right'
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
                     // error
256 256
                     toastr.remove();
257 257
                     toastr.error(
258
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
258
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
259 259
                         '', {
260 260
                             closeButton: true,
261 261
                             positionClass: 'toast-bottom-right'
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
                     // error
319 319
                     toastr.remove();
320 320
                     toastr.error(
321
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
321
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
322 322
                         '', {
323 323
                             closeButton: true,
324 324
                             positionClass: 'toast-bottom-right'
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
                     // error
418 418
                     toastr.remove();
419 419
                     toastr.error(
420
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
420
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
421 421
                         '', {
422 422
                             closeButton: true,
423 423
                             positionClass: 'toast-bottom-right'
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
                     
447 447
                     //const className = result.success ? 'success' : 'error';
448 448
                     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>';
449
-                    const message = result.success ? '<?php echo $lang->get('server_returned_data');?>' : 'Error: ' + result.error;
449
+                    const message = result.success ? '<?php echo $lang->get('server_returned_data'); ?>' : 'Error: ' + result.error;
450 450
                     
451 451
                     output += '<li>' + icon + '<b>' + file + '</b><br/>' + message + '</li>';
452 452
                 });
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
                     // error
478 478
                     toastr.remove();
479 479
                     toastr.error(
480
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
480
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
481 481
                         '', {
482 482
                             closeButton: true,
483 483
                             positionClass: 'toast-bottom-right'
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
                     // error
542 542
                     toastr.remove();
543 543
                     toastr.error(
544
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
544
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
545 545
                         '', {
546 546
                             closeButton: true,
547 547
                             positionClass: 'toast-bottom-right'
Please login to merge, or discard this patch.
sources/find.queries.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 ) {
74 74
     // Not allowed page
75 75
     $session->set('system-error_code', ERR_NOT_ALLOWED);
76
-    include $SETTINGS['cpassman_dir'] . '/error.php';
76
+    include $SETTINGS['cpassman_dir'].'/error.php';
77 77
     exit;
78 78
 }
79 79
 
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
 if (null === $session->get('user-accessible_folders')
93 93
     || empty($session->get('user-accessible_folders')) === true
94 94
 ) {
95
-    echo '{"sEcho": ' . $request->query->filter('sEcho', FILTER_SANITIZE_NUMBER_INT) . ' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }';
95
+    echo '{"sEcho": '.$request->query->filter('sEcho', FILTER_SANITIZE_NUMBER_INT).' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }';
96 96
     exit;
97 97
 }
98 98
 
99 99
 //Columns name
100
-$aColumns = ['c.id', 'c.label', 'c.login', 'c.description', 'c.tags', 'c.id_tree', 'c.folder', 'c.login', 'c.url', 'ci.data'];//
100
+$aColumns = ['c.id', 'c.label', 'c.login', 'c.description', 'c.tags', 'c.id_tree', 'c.folder', 'c.login', 'c.url', 'ci.data']; //
101 101
 $aSortTypes = ['ASC', 'DESC'];
102 102
 //init SQL variables
103 103
 $sOrder = $sLimit = $sWhere = '';
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 //Get current user "personal folder" ID
119 119
 $row = DB::query(
120
-    'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %i',
120
+    'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %i',
121 121
     intval($session->get('user-id'))
122 122
 );
123 123
 //get list of personal folders
@@ -126,20 +126,20 @@  discard block
 block discarded – undo
126 126
 $listPf = '';
127 127
 if (empty($row['id']) === false) {
128 128
     $rows = DB::query(
129
-        'SELECT id FROM ' . prefixTable('nested_tree') . '
129
+        'SELECT id FROM '.prefixTable('nested_tree').'
130 130
         WHERE personal_folder = 1 AND NOT parent_id = %i AND NOT title = %i',
131 131
         filter_var($row['id'], FILTER_SANITIZE_NUMBER_INT),
132 132
         filter_var($session->get('user-id'), FILTER_SANITIZE_NUMBER_INT)
133 133
     );
134 134
     foreach ($rows as $record) {
135
-        if (! in_array($record['id'], $arrayPf)) {
135
+        if (!in_array($record['id'], $arrayPf)) {
136 136
             //build an array of personal folders ids
137 137
             array_push($arrayPf, $record['id']);
138 138
             //build also a string with those ids
139 139
             if (empty($listPf)) {
140 140
                 $listPf = $record['id'];
141 141
             } else {
142
-                $listPf .= ', ' . $record['id'];
142
+                $listPf .= ', '.$record['id'];
143 143
             }
144 144
         }
145 145
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 //Paging
150 150
 $sLimit = '';
151 151
 if (null !== $request->query->get('start') && $request->query->get('length') !== '-1') {
152
-    $sLimit = 'LIMIT ' . $request->query->filter('start', null, FILTER_SANITIZE_NUMBER_INT) . ', ' . $request->query->filter('length', null, FILTER_SANITIZE_NUMBER_INT) . '';
152
+    $sLimit = 'LIMIT '.$request->query->filter('start', null, FILTER_SANITIZE_NUMBER_INT).', '.$request->query->filter('length', null, FILTER_SANITIZE_NUMBER_INT).'';
153 153
 }
154 154
 
155 155
 //Ordering
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
     }
164 164
     $sOrder = 'ORDER BY  ';
165 165
     if ($orderParam[0]['column'] >= 0) {
166
-        $sOrder .= '' . $aColumns[filter_var($orderParam[0]['column'], FILTER_SANITIZE_NUMBER_INT)] . ' '
167
-                . filter_var($orderParam[0]['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) . ', ';
166
+        $sOrder .= ''.$aColumns[filter_var($orderParam[0]['column'], FILTER_SANITIZE_NUMBER_INT)].' '
167
+                . filter_var($orderParam[0]['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS).', ';
168 168
     }
169 169
 
170 170
     $sOrder = substr_replace($sOrder, '', -2);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         $sOrder = '';
173 173
     }
174 174
 } else {
175
-    $sOrder = 'ORDER BY ' . $aColumns[1] . ' ASC';
175
+    $sOrder = 'ORDER BY '.$aColumns[1].' ASC';
176 176
 }
177 177
 
178 178
 // Define criteria
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
 if (empty($search_criteria) === false) {
197 197
     $sWhere .= ' AND (';
198 198
     for ($i = 0; $i < count($aColumns); ++$i) {
199
-        $sWhere .= $aColumns[$i] . ' LIKE %ss_' . $i . ' OR ';
199
+        $sWhere .= $aColumns[$i].' LIKE %ss_'.$i.' OR ';
200 200
     }
201
-    $sWhere = substr_replace((string) $sWhere, '', -3) . ') ';
201
+    $sWhere = substr_replace((string) $sWhere, '', -3).') ';
202 202
     $crit = [
203 203
         'idtree' => array_unique($folders),
204 204
         '0' => $search_criteria,
@@ -235,16 +235,16 @@  discard block
 block discarded – undo
235 235
 
236 236
 // Do NOT show the items in PERSONAL FOLDERS
237 237
 if (empty($listPf) === false) {
238
-    $sWhere = 'WHERE ' . $sWhere . ' AND c.id_tree NOT IN %ls_pf ';
238
+    $sWhere = 'WHERE '.$sWhere.' AND c.id_tree NOT IN %ls_pf ';
239 239
 } else {
240
-    $sWhere = 'WHERE ' . $sWhere;
240
+    $sWhere = 'WHERE '.$sWhere;
241 241
 }
242 242
 
243 243
 // Do queries
244 244
 DB::query(
245 245
     "SELECT c.id
246
-    FROM " . prefixTable('cache') . " AS c
247
-    LEFT JOIN " . prefixTable('categories_items') . " AS ci ON (ci.item_id = c.id)
246
+    FROM " . prefixTable('cache')." AS c
247
+    LEFT JOIN " . prefixTable('categories_items')." AS ci ON (ci.item_id = c.id)
248 248
     {$sWhere}
249 249
     {$sOrder}",
250 250
     $crit
@@ -252,9 +252,9 @@  discard block
 block discarded – undo
252 252
 $iTotal = DB::count();
253 253
 $rows = DB::query(
254 254
     "SELECT c.*, ci.data, i.item_key
255
-    FROM " . prefixTable('cache') . " AS c
256
-    LEFT JOIN " . prefixTable('categories_items') . " AS ci ON (ci.item_id = c.id)
257
-    INNER JOIN " . prefixTable('items') . " AS i ON (i.id = c.id)
255
+    FROM " . prefixTable('cache')." AS c
256
+    LEFT JOIN " . prefixTable('categories_items')." AS ci ON (ci.item_id = c.id)
257
+    INNER JOIN " . prefixTable('items')." AS i ON (i.id = c.id)
258 258
     {$sWhere}
259 259
     {$sOrder}
260 260
     {$sLimit}",
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 if (null === $request->query->get('type')) {
280 280
     $sOutput = '{';
281 281
     if (null !== $request->query->get('draw')) {
282
-        $sOutput .= '"draw": ' . $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
282
+        $sOutput .= '"draw": '.$request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
283 283
     }
284 284
     $sOutput .= '"data": [';
285 285
     $sOutputConst = '';
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             foreach (explode(';', $session->get('user-roles')) as $role) {
297 297
                 //db::debugmode(true);
298 298
                 $access = DB::queryFirstRow(
299
-                    'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
299
+                    'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
300 300
                     $role,
301 301
                     $record['id_tree']
302 302
                 );
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             }
317 317
             $accessLevel = count($arrTmp) > 0 ? min($arrTmp) : $accessLevel;
318 318
             if ($accessLevel === 0) {
319
-                $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"' . $record['id'] . '\">';
319
+                $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"'.$record['id'].'\">';
320 320
             }
321 321
 
322 322
             if ((int) $accessLevel === 0) {
@@ -356,22 +356,22 @@  discard block
 block discarded – undo
356 356
             if (empty($restrictedTo)) {
357 357
                 $restrictedTo = $session->get('user-id');
358 358
             } else {
359
-                $restrictedTo .= ',' . $session->get('user-id');
359
+                $restrictedTo .= ','.$session->get('user-id');
360 360
             }
361 361
         }
362 362
         
363 363
         //col1
364
-        $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"' . $lang->get('open_url_link') . '\" onClick=\"window.location.href=&#039;index.php?page=items&amp;group=' . $record['id_tree'] . '&amp;id=' . $record['id'] . '&#039;\" style=\"cursor:pointer;\"></i>' .
365
-        '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"' . stripslashes($lang->get('see_item_title')) . '\" data-id=\"' . $record['id'] . '\" data-perso=\"' . $record['perso'] . '\" data-tree-id=\"' . $record['id_tree'] . '\" data-expired=\"' . $expired . '\" data-restricted-to=\"' . $restrictedTo . '\" data-rights=\"' . $right . '\" style=\"cursor:pointer;\"></i>' . $checkbox . '",' ;
364
+        $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"'.$lang->get('open_url_link').'\" onClick=\"window.location.href=&#039;index.php?page=items&amp;group='.$record['id_tree'].'&amp;id='.$record['id'].'&#039;\" style=\"cursor:pointer;\"></i>'.
365
+        '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"'.stripslashes($lang->get('see_item_title')).'\" data-id=\"'.$record['id'].'\" data-perso=\"'.$record['perso'].'\" data-tree-id=\"'.$record['id_tree'].'\" data-expired=\"'.$expired.'\" data-restricted-to=\"'.$restrictedTo.'\" data-rights=\"'.$right.'\" style=\"cursor:pointer;\"></i>'.$checkbox.'",';
366 366
         //col2
367
-        $sOutputItem .= '"'.base64_encode('<span id=\"item_label-' . $record['id'] . '\">' . (str_replace("\\", "&#92;", (string) $record['label'])) . '</span>').'", ';   // replace backslash #3015
367
+        $sOutputItem .= '"'.base64_encode('<span id=\"item_label-'.$record['id'].'\">'.(str_replace("\\", "&#92;", (string) $record['label'])).'</span>').'", '; // replace backslash #3015
368 368
         //col3
369
-        $sOutputItem .= '"' . base64_encode(str_replace('&amp;', '&', htmlspecialchars(stripslashes((string) $record['login']), ENT_QUOTES))) . '", ';
369
+        $sOutputItem .= '"'.base64_encode(str_replace('&amp;', '&', htmlspecialchars(stripslashes((string) $record['login']), ENT_QUOTES))).'", ';
370 370
         //col4
371 371
         //get restriction from ROles
372 372
         $restrictedToRole = false;
373 373
         $rTmp = DB::queryFirstColumn(
374
-            'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i',
374
+            'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i',
375 375
             $record['id']
376 376
         );
377 377
         // We considere here that if user has at least one group similar to the object ones
@@ -389,14 +389,14 @@  discard block
 block discarded – undo
389 389
         } else {
390 390
             $txt = str_replace(['\n', '<br />', '\\'], [' ', ' ', '', ' '], strip_tags($record['description']));
391 391
             if (strlen($txt) > 50) {
392
-                $sOutputItem .= '"' . base64_encode(substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50)) . '", ';
392
+                $sOutputItem .= '"'.base64_encode(substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50)).'", ';
393 393
             } else {
394
-                $sOutputItem .= '"' . base64_encode(stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt))) . '", ';
394
+                $sOutputItem .= '"'.base64_encode(stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt))).'", ';
395 395
             }
396 396
         }
397 397
 
398 398
         //col5 - TAGS
399
-        $sOutputItem .= '"' . base64_encode(htmlspecialchars(stripslashes((string) $record['tags']), ENT_QUOTES)) . '", ';
399
+        $sOutputItem .= '"'.base64_encode(htmlspecialchars(stripslashes((string) $record['tags']), ENT_QUOTES)).'", ';
400 400
         // col6 - URL
401 401
         if ($record['url'] !== '0') {
402 402
             $sOutputItem .= '"'.htmlspecialchars(filter_var($record['url'], FILTER_SANITIZE_URL)).'", ';
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
         }
406 406
 
407 407
         //col7 - Prepare the Treegrid
408
-        $sOutputItem .= '"' . base64_encode(stripslashes((string) $record['folder'])) . '"';
408
+        $sOutputItem .= '"'.base64_encode(stripslashes((string) $record['folder'])).'"';
409 409
         //Finish the line
410 410
         //$sOutputItem .= '], ';
411 411
         if ($getItemInList === true) {
@@ -414,17 +414,17 @@  discard block
 block discarded – undo
414 414
             --$iTotal;
415 415
         }
416 416
     }
417
-    if (! empty($sOutputConst)) {
417
+    if (!empty($sOutputConst)) {
418 418
         $sOutput .= substr_replace($sOutputConst, '', -2);
419 419
     }
420 420
     $sOutput .= '], ';
421
-    $sOutput .= '"recordsTotal": ' . $iTotal . ', ';
422
-    $sOutput .= '"recordsFiltered": ' . $iTotal . ' }';
421
+    $sOutput .= '"recordsTotal": '.$iTotal.', ';
422
+    $sOutput .= '"recordsFiltered": '.$iTotal.' }';
423 423
     // file deepcode ignore XSS: data is secured
424 424
     echo ($sOutput);
425 425
 } elseif (null !== $request->query->get('type') && ($request->query->get('type') === 'search_for_items' || $request->query->get('type') === 'search_for_items_with_tags')) {
426 426
     include_once 'main.functions.php';
427
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $session->get('user-language') . '.php';
427
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$session->get('user-language').'.php';
428 428
 
429 429
     $totalItems = $request->query->filter('totalItems', null, FILTER_SANITIZE_NUMBER_INT);
430 430
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         $arr_data[$record['id']]['tree_id'] = (int) $record['id_tree'];
436 436
         $arr_data[$record['id']]['label'] = (string) $record['label'];
437 437
         $arr_data[$record['id']]['desc'] = (string) strip_tags(explode('<br>', $record['description'])[0]);
438
-        $arr_data[$record['id']]['folder'] = (string)$record['folder'];
438
+        $arr_data[$record['id']]['folder'] = (string) $record['folder'];
439 439
         $arr_data[$record['id']]['login'] = (string) strtr($record['login'], '"', '&quot;');
440 440
         $arr_data[$record['id']]['item_key'] = (string) $record['item_key'];
441 441
         $arr_data[$record['id']]['link'] = (string) $record['url'] !== '0' && empty($record['url']) === false ? filter_var($record['url'], FILTER_SANITIZE_URL) : '';
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 
449 449
         // Anyone can modify?
450 450
         $tmp = DB::queryFirstRow(
451
-            'SELECT anyone_can_modify FROM ' . prefixTable('items') . ' WHERE id = %i',
451
+            'SELECT anyone_can_modify FROM '.prefixTable('items').' WHERE id = %i',
452 452
             $record['id']
453 453
         );
454 454
         if (count($tmp) > 0) {
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
         $displayItem = $need_sk = $canMove = $item_is_restricted_to_role = 0;
478 478
         $user_is_included_in_role = 0;
479 479
         $roles = DB::query(
480
-            'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id=%i',
480
+            'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id=%i',
481 481
             $record['id']
482 482
         );
483 483
         if (count($roles) > 0) {
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
             if (empty($restrictedTo)) {
501 501
                 $restrictedTo = $session->get('user-id');
502 502
             } else {
503
-                $restrictedTo .= ',' . $session->get('user-id');
503
+                $restrictedTo .= ','.$session->get('user-id');
504 504
             }
505 505
         }
506 506
 
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
             $arrTmp = [];
617 617
             foreach (explode(';', $session->get('user-roles')) as $role) {
618 618
                 $access = DB::queryFirstRow(
619
-                    'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
619
+                    'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
620 620
                     $role,
621 621
                     $record['id_tree']
622 622
                 );
@@ -667,8 +667,8 @@  discard block
 block discarded – undo
667 667
         ) {
668 668
             $data_item = DB::queryFirstRow(
669 669
                 'SELECT i.pw AS pw, s.share_key AS share_key
670
-                FROM ' . prefixTable('items') . ' AS i
671
-                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
670
+                FROM ' . prefixTable('items').' AS i
671
+                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
672 672
                 WHERE i.id = %i AND s.user_id = %i',
673 673
                 $record['id'],
674 674
                 $session->get('user-id')
Please login to merge, or discard this patch.
sources/export.queries.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 ) {
79 79
     // Not allowed page
80 80
     $session->set('system-error_code', ERR_NOT_ALLOWED);
81
-    include $SETTINGS['cpassman_dir'] . '/error.php';
81
+    include $SETTINGS['cpassman_dir'].'/error.php';
82 82
     exit;
83 83
 }
84 84
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 $antiXss = new AntiXSS();
101 101
 
102 102
 // User's language loading
103
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $session->get('user-language') . '.php';
103
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$session->get('user-language').'.php';
104 104
 
105 105
 // Prepare POST variables
106 106
 $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
                         'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso,
152 152
                             i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url,
153 153
                             i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period
154
-                        FROM ' . prefixTable('items') . ' as i
155
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
156
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
154
+                        FROM ' . prefixTable('items').' as i
155
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
156
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
157 157
                         WHERE i.inactif = %i
158 158
                         AND i.id_tree= %i
159 159
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
                                 // Run query
177 177
                                 $dataItem = DB::queryFirstRow(
178 178
                                     'SELECT i.pw AS pw, s.share_key AS share_key
179
-                                    FROM ' . prefixTable('items') . ' AS i
180
-                                    INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
179
+                                    FROM ' . prefixTable('items').' AS i
180
+                                    INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
181 181
                                     WHERE user_id = %i AND i.id = %i',
182 182
                                     $session->get('user-id'),
183 183
                                     $record['id']
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
                                 $arr_kbs = [];
202 202
                                 $rows_kb = DB::query(
203 203
                                     'SELECT b.label, b.id
204
-                                    FROM ' . prefixTable('kb_items') . ' AS a
205
-                                    INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
204
+                                    FROM ' . prefixTable('kb_items').' AS a
205
+                                    INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
206 206
                                     WHERE a.item_id = %i',
207 207
                                     $record['id']
208 208
                                 );
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                                 $arr_tags = [];
215 215
                                 $rows_tag = DB::query(
216 216
                                     'SELECT tag
217
-                                    FROM ' . prefixTable('tags') . '
217
+                                    FROM ' . prefixTable('tags').'
218 218
                                     WHERE item_id = %i',
219 219
                                     $record['id']
220 220
                                 );
@@ -226,18 +226,18 @@  discard block
 block discarded – undo
226 226
                                 $arr_trees = [];
227 227
                                 $rows_child_tree = DB::query(
228 228
                                     'SELECT t.id, t.title
229
-                                    FROM ' . prefixTable('nested_tree') . ' AS t
230
-                                    INNER JOIN ' . prefixTable('items') . ' AS i ON (t.id = i.id_tree)
229
+                                    FROM ' . prefixTable('nested_tree').' AS t
230
+                                    INNER JOIN ' . prefixTable('items').' AS i ON (t.id = i.id_tree)
231 231
                                     WHERE i.id = %i',
232 232
                                     $record['id']
233 233
                                 );
234 234
                                 foreach ($rows_child_tree as $rec_child_tree) {
235 235
                                     $stack = array();
236 236
                                     $parent = $rec_child_tree['id'];
237
-                                    while($parent != 0){
237
+                                    while ($parent != 0) {
238 238
                                         $rows_parent_tree = DB::query(
239 239
                                             'SELECT parent_id, title
240
-                                            FROM ' . prefixTable('nested_tree') . '
240
+                                            FROM ' . prefixTable('nested_tree').'
241 241
                                             WHERE id = %i',
242 242
                                             $parent
243 243
                                         );
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             // Prepare variables
325 325
             $post_export_tag = filter_var($dataReceived['export_tag'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
326 326
             if (empty($post_export_tag) === false) {
327
-                DB::query('DELETE FROM ' . prefixTable('export') . ' WHERE export_tag = %s', $post_export_tag);
327
+                DB::query('DELETE FROM '.prefixTable('export').' WHERE export_tag = %s', $post_export_tag);
328 328
             }
329 329
             break;
330 330
 
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
                         l.date as date, i.pw_iv as pw_iv,
375 375
                         n.renewal_period as renewal_period,
376 376
                         i.id_tree as tree_id
377
-                        FROM ' . prefixTable('items') . ' as i
378
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
379
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
377
+                        FROM ' . prefixTable('items').' as i
378
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
379
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
380 380
                         WHERE i.inactif = %i
381 381
                         AND i.id_tree= %i
382 382
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -402,8 +402,8 @@  discard block
 block discarded – undo
402 402
                             // Run query
403 403
                             $dataItem = DB::queryFirstRow(
404 404
                                 'SELECT i.pw AS pw, s.share_key AS share_key
405
-                                FROM ' . prefixTable('items') . ' AS i
406
-                                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
405
+                                FROM ' . prefixTable('items').' AS i
406
+                                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
407 407
                                 WHERE user_id = %i AND i.id = %i',
408 408
                                 $session->get('user-id'),
409 409
                                 $record['id']
@@ -427,8 +427,8 @@  discard block
 block discarded – undo
427 427
                             $arr_kbs = '';
428 428
                             $rows_kb = DB::query(
429 429
                                 'SELECT b.label, b.id
430
-                                FROM ' . prefixTable('kb_items') . ' AS a
431
-                                INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
430
+                                FROM ' . prefixTable('kb_items').' AS a
431
+                                INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
432 432
                                 WHERE a.item_id = %i',
433 433
                                 $record['id']
434 434
                             );
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
                                 if (empty($arr_kbs)) {
437 437
                                     $arr_kbs = $rec_kb['label'];
438 438
                                 } else {
439
-                                    $arr_kbs .= ' | ' . $rec_kb['label'];
439
+                                    $arr_kbs .= ' | '.$rec_kb['label'];
440 440
                                 }
441 441
                             }
442 442
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
                             $arr_tags = '';
445 445
                             $rows_tag = DB::query(
446 446
                                 'SELECT tag
447
-                                FROM ' . prefixTable('tags') . '
447
+                                FROM ' . prefixTable('tags').'
448 448
                                 WHERE item_id = %i',
449 449
                                 $record['id']
450 450
                             );
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
                                 if (empty($arr_tags)) {
453 453
                                     $arr_tags = $rec_tag['tag'];
454 454
                                 } else {
455
-                                    $arr_tags .= ' ' . $rec_tag['tag'];
455
+                                    $arr_tags .= ' '.$rec_tag['tag'];
456 456
                                 }
457 457
                             }
458 458
 
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
             // query
531 531
             $rows = DB::query(
532 532
                 'SELECT * 
533
-                FROM ' . prefixTable('export') . ' 
533
+                FROM ' . prefixTable('export').' 
534 534
                 WHERE export_tag = %s',
535 535
                 $dataReceived['export_tag']
536 536
             );
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
                 $prev_path = '';
543 543
 
544 544
                 //Prepare the PDF file
545
-                require_once $SETTINGS['cpassman_dir'] . '/vendor/tecnickcom/tcpdf/tcpdf.php';
545
+                require_once $SETTINGS['cpassman_dir'].'/vendor/tecnickcom/tcpdf/tcpdf.php';
546 546
 
547 547
                 $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
548 548
                 $pdf->SetProtection(array('print'), $dataReceived['pdf_password'], null);
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 
555 555
                 // set default header data
556 556
                 $pdf->SetHeaderData(
557
-                    $SETTINGS['cpassman_dir'] . '/includes/images/teampass-logo2-home.png',
557
+                    $SETTINGS['cpassman_dir'].'/includes/images/teampass-logo2-home.png',
558 558
                     PDF_HEADER_LOGO_WIDTH,
559 559
                     'Teampass export',
560 560
                     $session->get('user-lastname')." ".$session->get('user-name').' @ '.date($SETTINGS['date_format']." ".$SETTINGS['time_format'], (int) time())
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
                 logEvents($SETTINGS, 'pdf_export', '', (string) $session->get('user-id'), $session->get('user-login'));
665 665
 
666 666
                 //clean table
667
-                DB::query('TRUNCATE TABLE ' . prefixTable('export'));
667
+                DB::query('TRUNCATE TABLE '.prefixTable('export'));
668 668
 
669 669
                 // Clean any content of the output buffer
670 670
                 ob_end_clean();
@@ -702,13 +702,13 @@  discard block
 block discarded – undo
702 702
             // step 1:
703 703
             // - prepare export file
704 704
             // - get full list of objects id to export
705
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
705
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
706 706
             $idsList = array();
707 707
 
708 708
             // query
709 709
             $rows = DB::query(
710 710
                 'SELECT * 
711
-                FROM ' . prefixTable('export') . ' 
711
+                FROM ' . prefixTable('export').' 
712 712
                 WHERE export_tag = %s',
713 713
                 $inputData['export_tag']
714 714
             );
@@ -745,13 +745,13 @@  discard block
 block discarded – undo
745 745
             }
746 746
             // prepare export file
747 747
             //save the file
748
-            $outstream = fopen($SETTINGS['path_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'], 'w');
748
+            $outstream = fopen($SETTINGS['path_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'], 'w');
749 749
             if ($outstream === false) {
750 750
                 echo (string) prepareExchangedData(
751 751
                     [
752 752
                         'error' => true,
753 753
                         'message' => $lang->get('error_while_creating_file'),
754
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
754
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
755 755
                     ],
756 756
                     'encode'
757 757
                 );
@@ -777,12 +777,12 @@  discard block
 block discarded – undo
777 777
     </style>
778 778
     </head>
779 779
     <body>
780
-    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $inputData['password']) . '" />
780
+    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $inputData['password']).'" />
781 781
     <div id="header">
782
-    ' . TP_TOOL_NAME . ' - Off Line mode
782
+    ' . TP_TOOL_NAME.' - Off Line mode
783 783
     </div>
784 784
     <div style="margin:10px; font-size:9px;">
785
-    <i>This page was generated by <b>' . $session->get('user-name') . ' ' . $session->get('user-lastname') . '</b>, the ' . date('Y/m/d H:i:s') . '.</i>
785
+    <i>This page was generated by <b>' . $session->get('user-name').' '.$session->get('user-lastname').'</b>, the '.date('Y/m/d H:i:s').'.</i>
786 786
     <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span>
787 787
     </div>
788 788
     <div id="information"></div>
@@ -793,11 +793,11 @@  discard block
 block discarded – undo
793 793
     <div>
794 794
     <table id="itemsTable">
795 795
         <thead><tr>
796
-            <th style="width:15%;">' . $lang->get('label') . '</th>
797
-            <th style="width:10%;">' . $lang->get('pw') . '</th>
798
-            <th style="width:30%;">' . $lang->get('description') . '</th>
799
-            <th style="width:5%;">' . $lang->get('user_login') . '</th>
800
-            <th style="width:20%;">' . $lang->get('url') . '</th>
796
+            <th style="width:15%;">' . $lang->get('label').'</th>
797
+            <th style="width:10%;">' . $lang->get('pw').'</th>
798
+            <th style="width:30%;">' . $lang->get('description').'</th>
799
+            <th style="width:5%;">' . $lang->get('user_login').'</th>
800
+            <th style="width:20%;">' . $lang->get('url').'</th>
801 801
         </tr></thead>
802 802
         <tbody id="itemsTable_tbody">'
803 803
             );
@@ -811,8 +811,8 @@  discard block
 block discarded – undo
811 811
                     'loop' => true,
812 812
                     'ids_list' => json_encode($idsList),
813 813
                     'ids_count' => count($idsList),
814
-                    'file_path' => $SETTINGS['path_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'],
815
-                    'file_link' => $SETTINGS['url_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'],
814
+                    'file_path' => $SETTINGS['path_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'],
815
+                    'file_link' => $SETTINGS['url_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'],
816 816
                     'export_tag' => $inputData['export_tag'],
817 817
                 ],
818 818
                 'encode'
@@ -851,12 +851,12 @@  discard block
 block discarded – undo
851 851
             $full_listing = array();
852 852
             $items_id_list = array();
853 853
             $outstream = '';
854
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
854
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
855 855
 
856 856
             // query
857 857
             $rows = DB::query(
858 858
                 'SELECT * 
859
-                FROM ' . prefixTable('export') . ' 
859
+                FROM ' . prefixTable('export').' 
860 860
                 WHERE export_tag = %s AND item_id IN %ls',
861 861
                 $inputData['export_tag'],
862 862
                 $inputData['idsList']
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
                         [
871 871
                             'error' => true,
872 872
                             'message' => $lang->get('error_while_creating_file'),
873
-                            'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
873
+                            'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
874 874
                         ],
875 875
                         'encode'
876 876
                     );
@@ -903,13 +903,13 @@  discard block
 block discarded – undo
903 903
                         if (empty($arboHtml)) {
904 904
                             $arboHtml = $arboHtml_tmp;
905 905
                         } else {
906
-                            $arboHtml .= ' » ' . $arboHtml_tmp;
906
+                            $arboHtml .= ' » '.$arboHtml_tmp;
907 907
                         }
908 908
                     }
909 909
                     fputs(
910 910
                         $outstream,
911 911
                         '
912
-        <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>'
912
+        <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>'
913 913
                     );
914 914
                     $idTree = $record['folder_id'];
915 915
 
@@ -917,12 +917,12 @@  discard block
 block discarded – undo
917 917
                     fputs(
918 918
                         $outstream,
919 919
                         '
920
-        <tr class="' . $lineType . '">
921
-            <td>' . addslashes($record['label']) . '</td>
922
-            <td align="center"><span class="span_pw" id="span_' . $record['item_id'] . '"><a href="#" onclick="decryptme(' . $record['item_id'] . ', \'' . $encPw . '\');return false;">Decrypt </a></span><input type="hidden" id="hide_' . $record['item_id'] . '" value="' . $encPw . '" /></td>
923
-            <td>' . (empty($record['description']) === true ? '&nbsp;' : addslashes(str_replace(array(';', '<br />'), array('|', "\n\r"), stripslashes(mb_convert_encoding($record['description'], 'ISO-8859-1', 'UTF-8'))))) . '</td>
924
-            <td align="center">' . (empty($record['login']) === true ? '&nbsp;' : addslashes($record['login'])) . '</td>
925
-            <td align="center">' . (empty($record['url']) === true ? '&nbsp;' : addslashes($record['url'])) . '</td>
920
+        <tr class="' . $lineType.'">
921
+            <td>' . addslashes($record['label']).'</td>
922
+            <td align="center"><span class="span_pw" id="span_' . $record['item_id'].'"><a href="#" onclick="decryptme('.$record['item_id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$record['item_id'].'" value="'.$encPw.'" /></td>
923
+            <td>' . (empty($record['description']) === true ? '&nbsp;' : addslashes(str_replace(array(';', '<br />'), array('|', "\n\r"), stripslashes(mb_convert_encoding($record['description'], 'ISO-8859-1', 'UTF-8'))))).'</td>
924
+            <td align="center">' . (empty($record['login']) === true ? '&nbsp;' : addslashes($record['login'])).'</td>
925
+            <td align="center">' . (empty($record['url']) === true ? '&nbsp;' : addslashes($record['url'])).'</td>
926 926
         </tr>'
927 927
                     );
928 928
                 }
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
             $inputData['password'] = (string) filter_var($dataReceived['password'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
972 972
             
973 973
             // Load includes
974
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
974
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
975 975
 
976 976
             // read the content of the temporary file
977 977
             $handle = fopen($inputData['filename'].'.txt', 'r');
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
                     [
981 981
                         'error' => true,
982 982
                         'message' => $lang->get('error_while_creating_file'),
983
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
983
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
984 984
                     ],
985 985
                     'encode'
986 986
                 );
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
                     [
993 993
                         'error' => true,
994 994
                         'message' => $lang->get('error_while_creating_file'),
995
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
995
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
996 996
                     ],
997 997
                     'encode'
998 998
                 );
@@ -1008,9 +1008,9 @@  discard block
 block discarded – undo
1008 1008
             $chunks = explode('|#|#|', chunk_split($contents, 10000, '|#|#|'));
1009 1009
             foreach ($chunks as $chunk) {
1010 1010
                 if (empty($encrypted_text) === true) {
1011
-                    $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password'] );
1011
+                    $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password']);
1012 1012
                 } else {
1013
-                    $encrypted_text .= '|#|#|' . GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password'] );
1013
+                    $encrypted_text .= '|#|#|'.GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password']);
1014 1014
                 }
1015 1015
             }
1016 1016
 
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
                     [
1022 1022
                         'error' => true,
1023 1023
                         'message' => $lang->get('error_while_creating_file'),
1024
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
1024
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
1025 1025
                     ],
1026 1026
                     'encode'
1027 1027
                 );
@@ -1034,9 +1034,9 @@  discard block
 block discarded – undo
1034 1034
         </table></div>
1035 1035
         <input type="button" value="Hide all" onclick="hideAll()" />
1036 1036
         <div id="footer" style="text-align:center;">
1037
-            <a href="https://teampass.net/about/" target="_blank">' . TP_TOOL_NAME . '&nbsp;' . TP_VERSION . '&nbsp;' . TP_COPYRIGHT . '</a>
1037
+            <a href="https://teampass.net/about/" target="_blank">' . TP_TOOL_NAME.'&nbsp;'.TP_VERSION.'&nbsp;'.TP_COPYRIGHT.'</a>
1038 1038
         </div>
1039
-        <div id="enc_html" style="display:none;">' . $encrypted_text . '</div>
1039
+        <div id="enc_html" style="display:none;">' . $encrypted_text.'</div>
1040 1040
         </body>
1041 1041
     </html>
1042 1042
     <script type="text/javascript">
@@ -1139,12 +1139,12 @@  discard block
 block discarded – undo
1139 1139
             fclose($outstream);
1140 1140
 
1141 1141
             //clean table
1142
-            DB::query('TRUNCATE TABLE ' . prefixTable('export'));
1142
+            DB::query('TRUNCATE TABLE '.prefixTable('export'));
1143 1143
 
1144 1144
             echo (string) prepareExchangedData(
1145 1145
                 [
1146 1146
                     'error' => false,
1147
-                    'filelink' => $inputData['file_link'] ,
1147
+                    'filelink' => $inputData['file_link'],
1148 1148
                 ],
1149 1149
                 'encode'
1150 1150
             );
Please login to merge, or discard this patch.