X-Git-Url: http://git.cyclocoop.org/?p=lhc%2Fweb%2Fclavette_www.git;a=blobdiff_plain;f=www%2Fecrire%2Finc%2Fflock.php;h=6a96201070516bdb82dd6cd1b5dfc584abb47b1a;hp=75b0fcb7b56b5a2e00b2fd65643f6637980dbd87;hb=cc641eb476987612f6d6df1a5417c1c5582a8ab8;hpb=7d84a490677fb716a1fd4df260f8eab35f6a8506 diff --git a/www/ecrire/inc/flock.php b/www/ecrire/inc/flock.php index 75b0fcb..6a96201 100644 --- a/www/ecrire/inc/flock.php +++ b/www/ecrire/inc/flock.php @@ -3,7 +3,7 @@ /***************************************************************************\ * SPIP, Systeme de publication pour l'internet * * * - * Copyright (c) 2001-2014 * + * Copyright (c) 2001-2016 * * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * * * * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * @@ -181,7 +181,9 @@ function ecrire_fichier ($fichier, $contenu, $ignorer_echec = false, $truncate=t // liberer le verrou et fermer le fichier @chmod($fichier, _SPIP_CHMOD & 0666); if ($ok) { - spip_clear_opcode_cache(realpath($fichier)); + if (strpos($fichier,".php")!==false){ + spip_clear_opcode_cache(realpath($fichier)); + } return $ok; } } @@ -415,14 +417,7 @@ function sous_repertoire($base, $subdir='', $nobase = false, $tantpis=false) { @mkdir($path, _SPIP_CHMOD); @chmod($path, _SPIP_CHMOD); - $ok = false; - if ($test = @fopen("$path/dir_test.php", "w")) { - @fputs($test, '<'.'?php $ok = true; ?'.'>'); - @fclose($test); - @include("$path/dir_test.php"); - spip_unlink("$path/dir_test.php"); - } - if ($ok) { + if (is_dir($path) && is_writable($path)) { @touch ("$path/.ok"); spip_log("creation $base$subdir/"); return $baseaff.($dirs[$base.$subdir] = "$subdir/"); @@ -440,7 +435,7 @@ function sous_repertoire($base, $subdir='', $nobase = false, $tantpis=false) { if (!_DIR_RESTREINT) $base = preg_replace(',^' . _DIR_RACINE .',', '',$base); $base .= $subdir; - raler_fichier($base . ($test?'/.ok':'/dir_test.php')); + raler_fichier($base . '/.plat'); } spip_log("faux sous-repertoire $base${subdir}"); return $baseaff.($dirs[$base.$subdir] = "${subdir}_");