@@ -73,7 +73,7 @@ discard block |
||
| 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 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | // Is a date sent? |
| 99 | 99 | $dateCriteria = $request->query->get('dateCriteria'); |
| 100 | 100 | if ($dateCriteria !== null && !empty($dateCriteria)) { |
| 101 | - $sWhere .= ' AND a.del_value < ' . round(filter_var($dateCriteria, FILTER_SANITIZE_NUMBER_INT) / 1000, 0); |
|
| 101 | + $sWhere .= ' AND a.del_value < '.round(filter_var($dateCriteria, FILTER_SANITIZE_NUMBER_INT) / 1000, 0); |
|
| 102 | 102 | } |
| 103 | 103 | //echo $sWhere; |
| 104 | 104 | /* BUILD QUERY */ |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $start = $request->query->getInt('start', 0); |
| 108 | 108 | $length = $request->query->getInt('length', -1); |
| 109 | 109 | if ($length !== -1) { |
| 110 | - $sLimit = ' LIMIT ' . $start . ', ' . $length; |
|
| 110 | + $sLimit = ' LIMIT '.$start.', '.$length; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | //Ordering |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $columnIndex = filter_var($order[0]['column'], FILTER_SANITIZE_NUMBER_INT); |
| 121 | 121 | |
| 122 | 122 | if (array_key_exists($columnIndex, $aColumns)) { |
| 123 | - $sOrder .= $aColumns[$columnIndex] . ' ' . $order[0]['dir']; |
|
| 123 | + $sOrder .= $aColumns[$columnIndex].' '.$order[0]['dir']; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | // Supprimez la virgule finale si elle existe |
@@ -144,9 +144,9 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | if ($letter !== '' && $letter !== 'None') { |
| 146 | 146 | $sWhere .= ' AND '; |
| 147 | - $sWhere .= $aColumns[1] . " LIKE '" . $letter . "%' OR "; |
|
| 148 | - $sWhere .= $aColumns[2] . " LIKE '" . $letter . "%' OR "; |
|
| 149 | - $sWhere .= $aColumns[3] . " LIKE '" . $letter . "%' "; |
|
| 147 | + $sWhere .= $aColumns[1]." LIKE '".$letter."%' OR "; |
|
| 148 | + $sWhere .= $aColumns[2]." LIKE '".$letter."%' OR "; |
|
| 149 | + $sWhere .= $aColumns[3]." LIKE '".$letter."%' "; |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
@@ -157,26 +157,26 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | if ($searchValue !== '') { |
| 159 | 159 | $sWhere = ' AND '; |
| 160 | - $sWhere .= $aColumns[1] . " LIKE '" . $searchValue . "%' OR "; |
|
| 161 | - $sWhere .= $aColumns[2] . " LIKE '" . $searchValue . "%' OR "; |
|
| 162 | - $sWhere .= $aColumns[3] . " LIKE '" . $searchValue . "%' "; |
|
| 160 | + $sWhere .= $aColumns[1]." LIKE '".$searchValue."%' OR "; |
|
| 161 | + $sWhere .= $aColumns[2]." LIKE '".$searchValue."%' OR "; |
|
| 162 | + $sWhere .= $aColumns[3]." LIKE '".$searchValue."%' "; |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | $rows = DB::query( |
| 168 | 168 | 'SELECT a.item_id, i.label, a.del_value, i.id_tree |
| 169 | - FROM ' . prefixTable('automatic_del') . ' AS a |
|
| 170 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' . |
|
| 169 | + FROM ' . prefixTable('automatic_del').' AS a |
|
| 170 | + INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'. |
|
| 171 | 171 | $sWhere. |
| 172 | 172 | (string) $sOrder |
| 173 | 173 | ); |
| 174 | 174 | $iTotal = DB::count(); |
| 175 | 175 | $rows = DB::query( |
| 176 | 176 | 'SELECT a.item_id, i.label, a.del_value, i.id_tree |
| 177 | - FROM ' . prefixTable('automatic_del') . ' AS a |
|
| 178 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' . |
|
| 179 | - $sWhere . |
|
| 177 | + FROM ' . prefixTable('automatic_del').' AS a |
|
| 178 | + INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'. |
|
| 179 | + $sWhere. |
|
| 180 | 180 | $sLimit |
| 181 | 181 | ); |
| 182 | 182 | $iFilteredTotal = DB::count(); |
@@ -194,18 +194,18 @@ discard block |
||
| 194 | 194 | // start the line |
| 195 | 195 | $sOutput .= '['; |
| 196 | 196 | // Column 1 |
| 197 | - $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"' . $record['item_id'] . '\" data-item-tree-id=\"' . $record['id_tree'] . '\"></i>", '; |
|
| 197 | + $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"'.$record['item_id'].'\" data-item-tree-id=\"'.$record['id_tree'].'\"></i>", '; |
|
| 198 | 198 | // Column 2 |
| 199 | - $sOutput .= '"' . $record['label'] . '", '; |
|
| 199 | + $sOutput .= '"'.$record['label'].'", '; |
|
| 200 | 200 | // Column 3 |
| 201 | - $sOutput .= '"' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['del_value']) . '", '; |
|
| 201 | + $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['del_value']).'", '; |
|
| 202 | 202 | // Column 4 |
| 203 | 203 | $path = []; |
| 204 | 204 | $treeDesc = $tree->getPath($record['id_tree'], true); |
| 205 | 205 | foreach ($treeDesc as $t) { |
| 206 | 206 | array_push($path, $t->title); |
| 207 | 207 | } |
| 208 | - $sOutput .= '"' . implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path) . '"],'; |
|
| 208 | + $sOutput .= '"'.implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path).'"],'; |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | if ($iTotal > 0) { |
@@ -218,4 +218,4 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | // finalize output |
| 221 | -echo '{"recordsTotal": ' . (int) $iTotal . ', "recordsFiltered": ' . (int) $iFilteredTotal . ', "data": ' . htmlspecialchars($sOutput); |
|
| 221 | +echo '{"recordsTotal": '.(int) $iTotal.', "recordsFiltered": '.(int) $iFilteredTotal.', "data": '.htmlspecialchars($sOutput); |
|
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('backups') === 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 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | </div> |
| 179 | 179 | <div class="alert alert-info ml-2 mt-3 mr-2 hidden" id="onthefly-restore-progress"> |
| 180 | 180 | <h5><i class="icon fa fa-info mr-2"></i><?php echo $lang->get('in_progress'); ?></h5> |
| 181 | - <i class="mr-2 fa-solid fa-rocket fa-beat"></i><?php echo $lang->get('restore_in_progress');?> <b><span id="onthefly-restore-progress-text">0</span>%</b> |
|
| 181 | + <i class="mr-2 fa-solid fa-rocket fa-beat"></i><?php echo $lang->get('restore_in_progress'); ?> <b><span id="onthefly-restore-progress-text">0</span>%</b> |
|
| 182 | 182 | </div> |
| 183 | 183 | <div class="row mt-3 hidden" id="onthefly-restore-finished"></div> |
| 184 | 184 | <div class="row mt-3"> |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | filter_input(INPUT_GET, 'code', FILTER_SANITIZE_FULL_SPECIAL_CHARS) |
| 87 | 87 | ); |
| 88 | 88 | |
| 89 | - if (DB::count() > 0 && (int) $data['timestamp'] === (int) filter_input(INPUT_GET, 'stamp', FILTER_VALIDATE_INT)) { |
|
| 89 | + if (DB::count() > 0 && (int) $data['timestamp'] === (int) filter_input(INPUT_GET, 'stamp', FILTER_VALIDATE_INT)) { |
|
| 90 | 90 | // otv is too old |
| 91 | 91 | if ($data['time_limit'] < time() || ($data['views'] + 1) > $data['max_views']) { |
| 92 | 92 | $html = '<div class="text-center text-danger"> |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | <tr><th>URL:</th><td>'.$url.'</td></tr> |
| 191 | 191 | </table></div> |
| 192 | 192 | <p class="mt-3 text-info"><i class="fas fa-info mr-2"></i>Copy carefully the data you need.<br>This page is visible until <b>'. |
| 193 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $dataItem['time_limit']).'</b> OR <b>'.($dataItem['max_views'] - ($dataItem['views']+1)).' more time(s)</b>.</div> |
|
| 193 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $dataItem['time_limit']).'</b> OR <b>'.($dataItem['max_views'] - ($dataItem['views'] + 1)).' more time(s)</b>.</div> |
|
| 194 | 194 | </div>'; |
| 195 | 195 | // log |
| 196 | 196 | logItems( |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('users') === false) { |
| 67 | 67 | // Not allowed page |
| 68 | 68 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 69 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 69 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 70 | 70 | exit; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -89,24 +89,24 @@ discard block |
||
| 89 | 89 | // If administrator then all roles are shown |
| 90 | 90 | // else only the Roles the users is associated to. |
| 91 | 91 | if ((int) $session->get('user-admin') === 1) { |
| 92 | - $optionsManagedBy .= '<option value="0">' . $lang->get('administrators_only') . '</option>'; |
|
| 92 | + $optionsManagedBy .= '<option value="0">'.$lang->get('administrators_only').'</option>'; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $rows = DB::query( |
| 96 | 96 | 'SELECT id, title, creator_id |
| 97 | - FROM ' . prefixTable('roles_title') . ' |
|
| 97 | + FROM ' . prefixTable('roles_title').' |
|
| 98 | 98 | ORDER BY title ASC' |
| 99 | 99 | ); |
| 100 | 100 | foreach ($rows as $record) { |
| 101 | 101 | if ((int) $session->get('user-admin') === 1 || in_array($record['id'], $session->get('user-roles_array')) === true) { |
| 102 | - $optionsManagedBy .= '<option value="' . $record['id'] . '">' . $lang->get('managers_of') . ' ' . addslashes($record['title']) . '</option>'; |
|
| 102 | + $optionsManagedBy .= '<option value="'.$record['id'].'">'.$lang->get('managers_of').' '.addslashes($record['title']).'</option>'; |
|
| 103 | 103 | } |
| 104 | 104 | if ( |
| 105 | 105 | (int) $session->get('user-admin') === 1 |
| 106 | 106 | || (((int) $session->get('user-manager') === 1 || (int) $session->get('user-can_manage_all_users') === 1) |
| 107 | 107 | && (in_array($record['id'], $userRoles) === true) || (int) $record['creator_id'] === (int) $session->get('user-id')) |
| 108 | 108 | ) { |
| 109 | - $optionsRoles .= '<option value="' . $record['id'] . '">' . addslashes($record['title']) . '</option>'; |
|
| 109 | + $optionsRoles .= '<option value="'.$record['id'].'">'.addslashes($record['title']).'</option>'; |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | for ($y = 1; $y < $t->nlevel; ++$y) { |
| 122 | 122 | $ident .= ' '; |
| 123 | 123 | } |
| 124 | - $foldersList .= '<option value="' . $t->id . '">' . $ident . htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8') . '</option>'; |
|
| 124 | + $foldersList .= '<option value="'.$t->id.'">'.$ident.htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8').'</option>'; |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | </button><?php |
| 159 | 159 | echo isset($SETTINGS['ldap_mode']) === true && (int) $SETTINGS['ldap_mode'] === 1 && (int) $session->get('user-admin') === 1 ? |
| 160 | 160 | '<button type="button" class="btn btn-primary btn-sm tp-action mr-2" data-action="ldap-sync"> |
| 161 | - <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization') . ' |
|
| 161 | + <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization').' |
|
| 162 | 162 | </button>' : ''; |
| 163 | 163 | ?> |
| 164 | 164 | </h3> |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | <!-- /.card-header --> |
| 168 | 168 | <div class="card-body form" id="users-list"> |
| 169 | - <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> |
|
| 169 | + <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> |
|
| 170 | 170 | <table id="table-users" class="table table-striped nowrap table-responsive-sm"> |
| 171 | 171 | <thead> |
| 172 | 172 | <tr> |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | <?php |
| 232 | 232 | foreach (TP_PW_COMPLEXITY as $entry) { |
| 233 | 233 | echo ' |
| 234 | - <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>'; |
|
| 234 | + <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>'; |
|
| 235 | 235 | } |
| 236 | 236 | ?> |
| 237 | 237 | </select> |
@@ -74,7 +74,9 @@ discard block |
||
| 74 | 74 | if ($args['step'] === 'create_users_files_key') { |
| 75 | 75 | // Loop on all files for this item |
| 76 | 76 | // and encrypt them for each user |
| 77 | - if (WIP === true) provideLog('[DEBUG] '.print_r($args['files_keys'], true), $SETTINGS); |
|
| 77 | + if (WIP === true) { |
|
| 78 | + provideLog('[DEBUG] '.print_r($args['files_keys'], true), $SETTINGS); |
|
| 79 | + } |
|
| 78 | 80 | foreach($args['files_keys'] as $file) { |
| 79 | 81 | storeUsersShareKey( |
| 80 | 82 | prefixTable('sharekeys_items'), |
@@ -91,7 +93,9 @@ discard block |
||
| 91 | 93 | } elseif ($args['step'] === 'create_users_fields_key') { |
| 92 | 94 | // Loop on all encrypted fields for this item |
| 93 | 95 | // and encrypt them for each user |
| 94 | - if (WIP === true) provideLog('[DEBUG] '.print_r($args, true), $SETTINGS); |
|
| 96 | + if (WIP === true) { |
|
| 97 | + provideLog('[DEBUG] '.print_r($args, true), $SETTINGS); |
|
| 98 | + } |
|
| 95 | 99 | foreach($args['fields_keys'] as $field) { |
| 96 | 100 | storeUsersShareKey( |
| 97 | 101 | prefixTable('sharekeys_fields'), |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $subtask = DB::queryFirstRow( |
| 56 | 56 | 'SELECT * |
| 57 | - FROM ' . prefixTable('background_subtasks') . ' |
|
| 57 | + FROM ' . prefixTable('background_subtasks').' |
|
| 58 | 58 | WHERE process_id = %i AND finished_at IS NULL |
| 59 | 59 | ORDER BY increment_id ASC', |
| 60 | 60 | (int) $request->request->get('subTask') |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | list($taskArguments) = DB::queryFirstField( |
| 64 | 64 | 'SELECT arguments |
| 65 | - FROM ' . prefixTable('background_tasks') . ' |
|
| 65 | + FROM ' . prefixTable('background_tasks').' |
|
| 66 | 66 | WHERE increment_id = %i', |
| 67 | 67 | $subtask['process_id'] |
| 68 | 68 | ); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // Loop on all files for this item |
| 74 | 74 | // and encrypt them for each user |
| 75 | 75 | if (WIP === true) provideLog('[DEBUG] '.print_r($args['files_keys'], true), $SETTINGS); |
| 76 | - foreach($args['files_keys'] as $file) { |
|
| 76 | + foreach ($args['files_keys'] as $file) { |
|
| 77 | 77 | storeUsersShareKey( |
| 78 | 78 | prefixTable('sharekeys_items'), |
| 79 | 79 | 0, |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | // Loop on all encrypted fields for this item |
| 90 | 90 | // and encrypt them for each user |
| 91 | 91 | if (WIP === true) provideLog('[DEBUG] '.print_r($args, true), $SETTINGS); |
| 92 | - foreach($args['fields_keys'] as $field) { |
|
| 92 | + foreach ($args['fields_keys'] as $field) { |
|
| 93 | 93 | storeUsersShareKey( |
| 94 | 94 | prefixTable('sharekeys_fields'), |
| 95 | 95 | 0, |
@@ -149,7 +149,9 @@ |
||
| 149 | 149 | } |
| 150 | 150 | $filePath = realpath($filePath); |
| 151 | 151 | |
| 152 | - if (WIP === true) error_log('downloadFile.php: filePath: ' . $filePath." - "); |
|
| 152 | + if (WIP === true) { |
|
| 153 | + error_log('downloadFile.php: filePath: ' . $filePath." - "); |
|
| 154 | + } |
|
| 153 | 155 | |
| 154 | 156 | if ($filePath && is_readable($filePath) && strpos($filePath, realpath($SETTINGS['path_to_upload_folder'])) === 0) { |
| 155 | 157 | header('Content-Description: File Transfer'); |
@@ -76,7 +76,7 @@ discard block |
||
| 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 | |
@@ -118,19 +118,19 @@ discard block |
||
| 118 | 118 | $get_filename = str_replace('"', '\"', $get_filename); |
| 119 | 119 | |
| 120 | 120 | // Use Content-Disposition header with double quotes around filename |
| 121 | -header('Content-Disposition: attachment; filename="' . rawurldecode($get_filename) . '"'); |
|
| 121 | +header('Content-Disposition: attachment; filename="'.rawurldecode($get_filename).'"'); |
|
| 122 | 122 | header('Content-Type: application/octet-stream'); |
| 123 | 123 | header('Cache-Control: must-revalidate, no-cache, no-store'); |
| 124 | 124 | header('Expires: 0'); |
| 125 | 125 | if (null !== $request->query->get('pathIsFiles') && (int) $get_pathIsFiles === 1) { |
| 126 | - readfile($SETTINGS['path_to_files_folder'] . '/' . basename($get_filename)); |
|
| 126 | + readfile($SETTINGS['path_to_files_folder'].'/'.basename($get_filename)); |
|
| 127 | 127 | } else { |
| 128 | 128 | // get file key |
| 129 | 129 | $file_info = DB::queryFirstRow( |
| 130 | 130 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension, |
| 131 | 131 | s.share_key AS share_key |
| 132 | - FROM ' . prefixTable('files') . ' AS f |
|
| 133 | - INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id) |
|
| 132 | + FROM ' . prefixTable('files').' AS f |
|
| 133 | + INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id) |
|
| 134 | 134 | WHERE s.user_id = %i AND s.object_id = %i', |
| 135 | 135 | $session->get('user-id'), |
| 136 | 136 | $get_fileid |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | // if not encrypted |
| 150 | 150 | $file_info = DB::queryFirstRow( |
| 151 | 151 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension |
| 152 | - FROM ' . prefixTable('files') . ' AS f |
|
| 152 | + FROM ' . prefixTable('files').' AS f |
|
| 153 | 153 | WHERE f.id = %i', |
| 154 | 154 | $get_fileid |
| 155 | 155 | ); |
@@ -159,25 +159,25 @@ discard block |
||
| 159 | 159 | // Set the filename of the download |
| 160 | 160 | $filename = basename($file_info['name'], '.'.$file_info['extension']); |
| 161 | 161 | $filename = isBase64($filename) === true ? base64_decode($filename) : $filename; |
| 162 | - $filename = $filename . '.' . $file_info['extension']; |
|
| 162 | + $filename = $filename.'.'.$file_info['extension']; |
|
| 163 | 163 | // Get the full path to the file to be downloaded |
| 164 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' .TP_FILE_PREFIX . $file_info['file'])) { |
|
| 165 | - $filePath = $SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . $file_info['file']; |
|
| 164 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.$file_info['file'])) { |
|
| 165 | + $filePath = $SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.$file_info['file']; |
|
| 166 | 166 | } else { |
| 167 | - $filePath = $SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($file_info['file']); |
|
| 167 | + $filePath = $SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($file_info['file']); |
|
| 168 | 168 | } |
| 169 | 169 | $filePath = realpath($filePath); |
| 170 | 170 | |
| 171 | - if (WIP === true) error_log('downloadFile.php: filePath: ' . $filePath." - "); |
|
| 171 | + if (WIP === true) error_log('downloadFile.php: filePath: '.$filePath." - "); |
|
| 172 | 172 | |
| 173 | 173 | if ($filePath && is_readable($filePath) && strpos($filePath, realpath($SETTINGS['path_to_upload_folder'])) === 0) { |
| 174 | 174 | header('Content-Description: File Transfer'); |
| 175 | 175 | header('Content-Type: application/octet-stream'); |
| 176 | - header('Content-Disposition: attachment; filename="' . basename($filename) . '"'); |
|
| 176 | + header('Content-Disposition: attachment; filename="'.basename($filename).'"'); |
|
| 177 | 177 | header('Expires: 0'); |
| 178 | 178 | header('Cache-Control: must-revalidate'); |
| 179 | 179 | header('Pragma: public'); |
| 180 | - header('Content-Length: ' . filesize($filePath)); |
|
| 180 | + header('Content-Length: '.filesize($filePath)); |
|
| 181 | 181 | flush(); // Clear system output buffer |
| 182 | 182 | if (empty($fileContent) === true) { |
| 183 | 183 | // deepcode ignore PT: File and path are secured directly inside the function decryptFile() |
@@ -78,7 +78,7 @@ discard block |
||
| 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 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | // get exec from processes table |
| 164 | 164 | $rows = DB::query( |
| 165 | 165 | 'SELECT max(finished_at), process_type |
| 166 | - FROM ' . prefixTable('background_tasks') . ' |
|
| 166 | + FROM ' . prefixTable('background_tasks').' |
|
| 167 | 167 | GROUP BY process_type' |
| 168 | 168 | ); |
| 169 | 169 | foreach ($rows as $row) { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | // get exec from background_tasks_log table |
| 180 | 180 | $rows = DB::query( |
| 181 | 181 | 'SELECT MAX(finished_at) AS max_finished_at, job AS process_type |
| 182 | - FROM ' . prefixTable('background_tasks_logs') . ' |
|
| 182 | + FROM ' . prefixTable('background_tasks_logs').' |
|
| 183 | 183 | WHERE finished_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY)) |
| 184 | 184 | GROUP BY process_type' |
| 185 | 185 | ); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $requestUri = $request->getRequestUri(); |
| 48 | 48 | |
| 49 | 49 | $uri = parse_url($requestUri, PHP_URL_PATH); |
| 50 | - $uri = explode( '/', $uri ); |
|
| 50 | + $uri = explode('/', $uri); |
|
| 51 | 51 | return $this->sanitizeUrl(array_slice($uri, ((int) array_search('index.php', $uri) + 1))); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | $filters = []; |
| 76 | 76 | $array_size = count($array); |
| 77 | - for ($i=0; $i < $array_size; $i++) { |
|
| 77 | + for ($i = 0; $i < $array_size; $i++) { |
|
| 78 | 78 | array_push($filters, 'trim|escape'); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @param mixed $data |
| 93 | 93 | * @param string $httpHeader |
| 94 | 94 | */ |
| 95 | - protected function sendOutput($data, $httpHeaders=array()): void |
|
| 95 | + protected function sendOutput($data, $httpHeaders = array()): void |
|
| 96 | 96 | { |
| 97 | 97 | header_remove('Set-Cookie'); |
| 98 | 98 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $arrFolders = $folderModel->getFoldersInfo(explode(",", $userData['folders_list'])); |
| 49 | 49 | $responseData = json_encode($arrFolders); |
| 50 | 50 | } catch (Error $e) { |
| 51 | - $strErrorDesc = $e->getMessage() . ' Something went wrong! Please contact support.3'; |
|
| 51 | + $strErrorDesc = $e->getMessage().' Something went wrong! Please contact support.3'; |
|
| 52 | 52 | $strErrorHeader = 'HTTP/1.1 500 Internal Server Error'; |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | $responseData = json_encode($arrFolder); |
| 123 | 123 | } catch (Error $e) { |
| 124 | - $strErrorDesc = $e->getMessage() . ' Something went wrong! Please contact support.1'; |
|
| 124 | + $strErrorDesc = $e->getMessage().' Something went wrong! Please contact support.1'; |
|
| 125 | 125 | $strErrorHeader = 'HTTP/1.1 500 Internal Server Error'; |
| 126 | 126 | } |
| 127 | 127 | } |