@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | if (dol_is_file($filetpl)) { |
149 | 149 | if ($backupold) { |
150 | 150 | $result = manageFileBackups($filetpl); |
151 | - if (! $result) { |
|
151 | + if (!$result) { |
|
152 | 152 | return false; |
153 | 153 | } |
154 | 154 | } else { |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; |
344 | 344 | $indexcontent .= ' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'."\n"; |
345 | 345 | $indexcontent .= "}\n"; |
346 | - $indexcontent .= "include_once '".$relpath."/".basename($filetpl)."'\n"; // use .. instead of . |
|
346 | + $indexcontent .= "include_once '".$relpath."/".basename($filetpl)."'\n"; // use .. instead of . |
|
347 | 347 | $indexcontent .= '// END PHP ?>'."\n"; |
348 | 348 | $result = file_put_contents($fileindexsub, $indexcontent); |
349 | 349 | if ($result === false) { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | 'types' => $types, |
116 | 116 | 'recursive' => $recursive, |
117 | 117 | 'filter' => $filter, |
118 | - 'excludefilter' => $exclude_array, // Already converted to array. |
|
118 | + 'excludefilter' => $exclude_array, // Already converted to array. |
|
119 | 119 | 'sortcriteria' => $sortcriteria, |
120 | 120 | 'sortorder' => $sortorder, |
121 | 121 | 'loaddate' => $loaddate, |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | $qualified = 1; |
151 | 151 | |
152 | - $utf8_fullpathfile = "$utf8_path/$utf8_file"; // Temp variable for speed |
|
152 | + $utf8_fullpathfile = "$utf8_path/$utf8_file"; // Temp variable for speed |
|
153 | 153 | |
154 | 154 | // Check if file is qualified |
155 | 155 | foreach ($excludefilterarray as $filt) { |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | } |
1123 | 1123 | |
1124 | 1124 | if ($resultecm > 0) { |
1125 | - $result = true; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
1125 | + $result = true; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
1126 | 1126 | } else { |
1127 | 1127 | $result = false; |
1128 | 1128 | } |
@@ -1197,7 +1197,7 @@ discard block |
||
1197 | 1197 | } |
1198 | 1198 | } |
1199 | 1199 | } |
1200 | - $result = true; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
1200 | + $result = true; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
1201 | 1201 | } |
1202 | 1202 | } |
1203 | 1203 | } |
@@ -1409,7 +1409,7 @@ discard block |
||
1409 | 1409 | $return = move_uploaded_file($src_file_osencoded, $file_name_osencoded); |
1410 | 1410 | if ($return) { |
1411 | 1411 | dolChmod($file_name_osencoded); |
1412 | - dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=" . getDolGlobalString('MAIN_UMASK'), LOG_DEBUG); |
|
1412 | + dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".getDolGlobalString('MAIN_UMASK'), LOG_DEBUG); |
|
1413 | 1413 | return $successcode; // Success |
1414 | 1414 | } else { |
1415 | 1415 | dol_syslog("Files.lib::dol_move_uploaded_file Failed to move ".$src_file." to ".$file_name, LOG_ERR); |
@@ -1922,7 +1922,7 @@ discard block |
||
1922 | 1922 | $maxwidthmini = $tmparraysize['maxwidthmini']; |
1923 | 1923 | $maxheightmini = $tmparraysize['maxheightmini']; |
1924 | 1924 | //$quality = $tmparraysize['quality']; |
1925 | - $quality = 50; // For thumbs, we force quality to 50 |
|
1925 | + $quality = 50; // For thumbs, we force quality to 50 |
|
1926 | 1926 | |
1927 | 1927 | // Generate thumbs. |
1928 | 1928 | if ($generatethumbs) { |
@@ -2106,7 +2106,7 @@ discard block |
||
2106 | 2106 | if (isset($object->table_element)) { |
2107 | 2107 | $ecmfile->src_object_type = $object->table_element; |
2108 | 2108 | } else { |
2109 | - dol_syslog('Error: object ' . get_class($object) . ' has no table_element attribute.'); |
|
2109 | + dol_syslog('Error: object '.get_class($object).' has no table_element attribute.'); |
|
2110 | 2110 | return -1; |
2111 | 2111 | } |
2112 | 2112 | if (isset($object->src_object_description)) { |
@@ -2350,9 +2350,9 @@ discard block |
||
2350 | 2350 | // Skip directories (they would be added automatically) |
2351 | 2351 | if (!$file->isDir()) { |
2352 | 2352 | // Get real and relative path for current file |
2353 | - $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
2353 | + $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
2354 | 2354 | $fileName = $file->getFilename(); |
2355 | - $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
2355 | + $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
2356 | 2356 | |
2357 | 2357 | //$relativePath = substr($fileFullRealPath, strlen($rootPath) + 1); |
2358 | 2358 | $relativePath = substr(($filePath ? $filePath.'/' : '').$fileName, strlen($rootPath) + 1); |
@@ -2576,9 +2576,9 @@ discard block |
||
2576 | 2576 | |
2577 | 2577 | try { |
2578 | 2578 | if ($mode == 'gz') { |
2579 | - $foundhandler = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
2579 | + $foundhandler = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
2580 | 2580 | } elseif ($mode == 'bz') { |
2581 | - $foundhandler = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
2581 | + $foundhandler = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
2582 | 2582 | } elseif ($mode == 'zip') { |
2583 | 2583 | /*if (defined('ODTPHP_PATHTOPCLZIP')) |
2584 | 2584 | { |
@@ -2619,9 +2619,9 @@ discard block |
||
2619 | 2619 | // Skip directories (they would be added automatically) |
2620 | 2620 | if (!$file->isDir()) { |
2621 | 2621 | // Get real and relative path for current file |
2622 | - $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
2622 | + $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
2623 | 2623 | $fileName = $file->getFilename(); |
2624 | - $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
2624 | + $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
2625 | 2625 | |
2626 | 2626 | //$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($fileFullRealPath, strlen($inputdir) + 1); |
2627 | 2627 | $relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr(($filePath ? $filePath.'/' : '').$fileName, strlen($inputdir) + 1); |
@@ -2794,7 +2794,7 @@ discard block |
||
2794 | 2794 | $original_file = $conf->mycompany->dir_output.'/'.$original_file; |
2795 | 2795 | } elseif ($modulepart == 'userphoto' && !empty($conf->user->dir_output)) { |
2796 | 2796 | // Wrapping for users photos (user photos are allowed to any connected users) |
2797 | - $accessallowed = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
2797 | + $accessallowed = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
2798 | 2798 | if (preg_match('/^\d+\/photos\//', $original_file)) { |
2799 | 2799 | $accessallowed = 1; |
2800 | 2800 | } |
@@ -2830,7 +2830,7 @@ discard block |
||
2830 | 2830 | $original_file = $conf->mycompany->dir_output.'/logos/'.$original_file; |
2831 | 2831 | } elseif ($modulepart == 'memberphoto' && !empty($conf->member->dir_output)) { |
2832 | 2832 | // Wrapping for members photos |
2833 | - $accessallowed = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
2833 | + $accessallowed = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
2834 | 2834 | if (preg_match('/^\d+\/photos\//', $original_file)) { |
2835 | 2835 | $accessallowed = 1; |
2836 | 2836 | } |
@@ -3699,7 +3699,7 @@ discard block |
||
3699 | 3699 | function manageFileBackups($filetpl, $max_versions = 5, $archivedir = '', $suffix = "v", $moveorcopy = 'move') |
3700 | 3700 | { |
3701 | 3701 | $base_file_pattern = ($archivedir ? $archivedir : dirname($filetpl)).'/'.basename($filetpl).".".$suffix; |
3702 | - $files_in_directory = glob($base_file_pattern . "*"); |
|
3702 | + $files_in_directory = glob($base_file_pattern."*"); |
|
3703 | 3703 | |
3704 | 3704 | // Extract the modification timestamps for each file |
3705 | 3705 | $files_with_timestamps = []; |
@@ -3740,7 +3740,7 @@ discard block |
||
3740 | 3740 | } |
3741 | 3741 | |
3742 | 3742 | $timestamp = dol_now('gmt'); |
3743 | - $new_backup = $filetpl . ".v" . $timestamp; |
|
3743 | + $new_backup = $filetpl.".v".$timestamp; |
|
3744 | 3744 | |
3745 | 3745 | // Move or copy the original file to the new backup with the timestamp |
3746 | 3746 | if ($moveorcopy == 'move') { |