diff --git a/ecrire/exec/admin_tech.php b/ecrire/exec/admin_tech.php index c2a965347a2dcc2a556e8f6983ea832e080d29f7..dba3810aae232565b06b1227b8c0f62059a13a2b 100644 --- a/ecrire/exec/admin_tech.php +++ b/ecrire/exec/admin_tech.php @@ -102,7 +102,9 @@ echo "</table>"; // if ($connect_toutes_rubriques) { - $liste_dump = preg_files(_DIR_DUMP,str_replace("@stamp@","(_[0-9]{6,8}_[0-9]{1,3})?",_SPIP_DUMP)."(.gz)?$",50,false); + $pattern = str_replace("@nom_site@","([^.0-9]*)",_SPIP_DUMP); + $pattern = str_replace("@stamp@","(_[0-9]{6,8}_[0-9]{1,3})?",$pattern)."(.gz)?$"; + $liste_dump = preg_files(_DIR_DUMP,$pattern,50,false); $selected = end($liste_dump); $liste_choix = "<ul>"; foreach($liste_dump as $key=>$fichier){ @@ -120,10 +122,10 @@ echo "</table>"; } if ($flag_gz) { - $fichier_defaut = str_replace("@stamp@","",_SPIP_DUMP) . '.gz'; + $fichier_defaut = str_replace(array("@stamp@","@nom_site@"),array("",""),_SPIP_DUMP) . '.gz'; $texte_compresse = _T('texte_compresse_ou_non')." "; } else { - $fichier_defaut = str_replace("@stamp@","",_SPIP_DUMP); + $fichier_defaut = str_replace(array("@stamp@","@nom_site@"),array("",""),_SPIP_DUMP); $texte_compresse = _T('texte_non_compresse')." "; } diff --git a/ecrire/inc/export.php b/ecrire/inc/export.php index 2a7ef7473268e57a4bf37a127ddb06e38ac2ad9b..779ac66784e13c109a646d2479228a63070be09e 100644 --- a/ecrire/inc/export.php +++ b/ecrire/inc/export.php @@ -16,7 +16,9 @@ $GLOBALS['version_archive'] = '1.3'; // http://doc.spip.org/@export_nom_fichier_dump function export_nom_fichier_dump($dir,$gz=true){ - $archive = _SPIP_DUMP; + $nom_site = isset($GLOBALS['meta']['nom_site'])?$GLOBALS['meta']['nom_site']:''; + $nom_site = preg_replace(",[^a-z],is","_",trim($nom_site)); + $archive = str_replace('@nom_site@',"_{$nom_site}_",_SPIP_DUMP); if ($gz) $archive .= '.gz'; $cpt=0; $stamp = date('Ymd'); diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php index b65ddb108c345cdeeb65aed02322207efc52fcf8..42a7baf246d476616317e0463cad2c22d1a7b4d9 100644 --- a/ecrire/inc/utils.php +++ b/ecrire/inc/utils.php @@ -990,7 +990,7 @@ function spip_initialisation($pi=NULL, $pa=NULL, $ti=NULL, $ta=NULL) { // qq chaines standard define('_ACCESS_FILE_NAME', '.htaccess'); define('_AUTH_USER_FILE', '.htpasswd'); - define('_SPIP_DUMP', 'dump@stamp@.xml'); + define('_SPIP_DUMP', 'dump@nom_site@@stamp@.xml'); define('_DOCTYPE_ECRIRE', // "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>\n");