Simplifie le code d'enregistrement des fichiers de l'editeur
This commit is contained in:
parent
7b2f399d72
commit
990a2a4247
|
@ -51,7 +51,7 @@ if (isset($cancel) && $cancel) {
|
|||
}
|
||||
|
||||
if (isset($saveret) && $saveret) {
|
||||
if ($bro->Save($editfile,$R,$texte)) {
|
||||
if ($bro->save($editfile,$R,$texte)) {
|
||||
$error=sprintf(_("Your file %s has been saved"),$editfile)." (".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s")).")";
|
||||
} else {
|
||||
$error=$err->errstr();
|
||||
|
@ -60,7 +60,7 @@ if (isset($saveret) && $saveret) {
|
|||
exit();
|
||||
}
|
||||
if (isset($save) && $save) {
|
||||
if ($bro->Save($editfile,$R,$texte)) {
|
||||
if ($bro->save($editfile,$R,$texte)) {
|
||||
$error=sprintf(_("Your file %s has been saved"),$editfile)." (".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s")).")";
|
||||
} else {
|
||||
$error=$err->errstr();
|
||||
|
|
|
@ -887,11 +887,7 @@ class m_bro {
|
|||
if (!strpos($file,"/")) {
|
||||
$absolute.="/".$file;
|
||||
if (file_exists($absolute)) {
|
||||
$f=@fopen($absolute,"wb");
|
||||
if ($f) {
|
||||
fputs($f,$texte,strlen($texte));
|
||||
fclose($f);
|
||||
} else {
|
||||
if (! file_put_contents($absolute, $texte ) ) {
|
||||
$err->raise("bro",_("Cannot edit the requested file. Please check the permissions"));
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue