@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $contenu = @gzfile($fichier); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - return is_array($contenu) ? implode('', $contenu) : (string)$contenu; |
|
| 124 | + return is_array($contenu) ? implode('', $contenu) : (string) $contenu; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
@@ -321,9 +321,9 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | function ecrire_fichier_securise($fichier, $contenu, $ecrire_quand_meme = false, $truncate = true) { |
| 323 | 323 | if (!str_ends_with($fichier, '.php')) { |
| 324 | - spip_log('Erreur de programmation: ' . $fichier . ' doit finir par .php'); |
|
| 324 | + spip_log('Erreur de programmation: '.$fichier.' doit finir par .php'); |
|
| 325 | 325 | } |
| 326 | - $contenu = '<' . "?php die ('Acces interdit'); ?" . ">\n" . $contenu; |
|
| 326 | + $contenu = '<'."?php die ('Acces interdit'); ?".">\n".$contenu; |
|
| 327 | 327 | |
| 328 | 328 | return ecrire_fichier($fichier, $contenu, $ecrire_quand_meme, $truncate); |
| 329 | 329 | } |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | * @return bool |
| 337 | 337 | */ |
| 338 | 338 | function ecrire_fichier_calcule_si_modifie($fichier, $contenu, $force = false, $use_copy = false) { |
| 339 | - $fichier_tmp = $fichier . '.last'; |
|
| 339 | + $fichier_tmp = $fichier.'.last'; |
|
| 340 | 340 | if (!ecrire_fichier($fichier_tmp, $contenu, true)) { |
| 341 | 341 | return false; |
| 342 | 342 | } |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | */ |
| 377 | 377 | function lire_fichier_securise($fichier, &$contenu, $options = []) { |
| 378 | 378 | if ($res = lire_fichier($fichier, $contenu, $options)) { |
| 379 | - $contenu = substr((string) $contenu, strlen('<?php die (\'Acces interdit\'); ?>' . "\n")); |
|
| 379 | + $contenu = substr((string) $contenu, strlen('<?php die (\'Acces interdit\'); ?>'."\n")); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | return $res; |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | $wait = 0; |
| 547 | 547 | } |
| 548 | 548 | } |
| 549 | - spip_log('Probleme de configuration opcache.revalidate_freq ' . $duree . 's : on attend ' . $wait . 's', _LOG_INFO_IMPORTANTE); |
|
| 549 | + spip_log('Probleme de configuration opcache.revalidate_freq '.$duree.'s : on attend '.$wait.'s', _LOG_INFO_IMPORTANTE); |
|
| 550 | 550 | if ($wait) { |
| 551 | 551 | sleep($duree + 1); |
| 552 | 552 | } |
@@ -574,9 +574,9 @@ discard block |
||
| 574 | 574 | if ($item == '.' || $item == '..') { |
| 575 | 575 | continue; |
| 576 | 576 | } |
| 577 | - if (!supprimer_repertoire($dir . '/' . $item)) { |
|
| 578 | - @chmod($dir . '/' . $item, 0777); |
|
| 579 | - if (!supprimer_repertoire($dir . '/' . $item)) { |
|
| 577 | + if (!supprimer_repertoire($dir.'/'.$item)) { |
|
| 578 | + @chmod($dir.'/'.$item, 0777); |
|
| 579 | + if (!supprimer_repertoire($dir.'/'.$item)) { |
|
| 580 | 580 | return false; |
| 581 | 581 | } |
| 582 | 582 | }; |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | if (!strlen($subdir)) { |
| 622 | 622 | $n = strrpos($base, '/'); |
| 623 | 623 | if ($n === false) { |
| 624 | - return $nobase ? '' : ($base . '/'); |
|
| 624 | + return $nobase ? '' : ($base.'/'); |
|
| 625 | 625 | } |
| 626 | 626 | $subdir = substr($base, $n + 1); |
| 627 | 627 | $base = substr($base, 0, $n + 1); |
@@ -631,14 +631,14 @@ discard block |
||
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | $baseaff = $nobase ? '' : $base; |
| 634 | - if (isset($dirs[$base . $subdir])) { |
|
| 635 | - return $baseaff . $dirs[$base . $subdir]; |
|
| 634 | + if (isset($dirs[$base.$subdir])) { |
|
| 635 | + return $baseaff.$dirs[$base.$subdir]; |
|
| 636 | 636 | } |
| 637 | 637 | |
| 638 | - $path = $base . $subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf' |
|
| 638 | + $path = $base.$subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf' |
|
| 639 | 639 | |
| 640 | 640 | if (file_exists("$path/.ok")) { |
| 641 | - return $baseaff . ($dirs[$base . $subdir] = "$subdir/"); |
|
| 641 | + return $baseaff.($dirs[$base.$subdir] = "$subdir/"); |
|
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | @mkdir($path, _SPIP_CHMOD); |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | @touch("$path/.ok"); |
| 649 | 649 | spip_log("creation $base$subdir/"); |
| 650 | 650 | |
| 651 | - return $baseaff . ($dirs[$base . $subdir] = "$subdir/"); |
|
| 651 | + return $baseaff.($dirs[$base.$subdir] = "$subdir/"); |
|
| 652 | 652 | } |
| 653 | 653 | |
| 654 | 654 | // en cas d'echec c'est peut etre tout simplement que le disque est plein : |
@@ -659,10 +659,10 @@ discard block |
||
| 659 | 659 | } |
| 660 | 660 | // FIXME: throw an Exception… |
| 661 | 661 | if (!_DIR_RESTREINT) { |
| 662 | - $base = preg_replace(',^' . _DIR_RACINE . ',', '', $base); |
|
| 662 | + $base = preg_replace(',^'._DIR_RACINE.',', '', $base); |
|
| 663 | 663 | } |
| 664 | 664 | $base .= $subdir; |
| 665 | - raler_fichier($base . '/.ok'); |
|
| 665 | + raler_fichier($base.'/.ok'); |
|
| 666 | 666 | } |
| 667 | 667 | |
| 668 | 668 | |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | $maxfiles - $nbfiles, |
| 735 | 735 | $recurs |
| 736 | 736 | ); |
| 737 | - $fichiers = array_merge((array)$beginning, (array)$end); |
|
| 737 | + $fichiers = array_merge((array) $beginning, (array) $end); |
|
| 738 | 738 | $nbfiles = count($fichiers); |
| 739 | 739 | } |
| 740 | 740 | } |