[9.0.12] check no folder with same pageId

This commit is contained in:
fredtempez 2019-03-25 09:38:49 +01:00
parent c9c5fedd7e
commit 89f5bcab00
3 changed files with 7 additions and 7 deletions

View File

@ -28,7 +28,7 @@ class common {
const GROUP_ADMIN = 3; const GROUP_ADMIN = 3;
// Numéro de version stable // Numéro de version stable
const ZWII_VERSION = '9.0.11'; const ZWII_VERSION = '9.0.12';
public static $actions = []; public static $actions = [];
public static $coreModuleIds = [ public static $coreModuleIds = [
@ -1446,10 +1446,6 @@ class helper {
if(intval($text) !== 0) { if(intval($text) !== 0) {
$text = 'i' . $text; $text = 'i' . $text;
} }
// un dossier existe du même nom (erreur en cas de redirection)
if (file_exists($text)) {
$text = 'p-' . $text;
}
break; break;
case self::FILTER_INT: case self::FILTER_INT:
$text = (int) filter_var($text, FILTER_SANITIZE_NUMBER_INT); $text = (int) filter_var($text, FILTER_SANITIZE_NUMBER_INT);

View File

@ -162,6 +162,10 @@ class page extends common {
// Soumission du formulaire // Soumission du formulaire
if($this->isPost()) { if($this->isPost()) {
$pageId = $this->getInput('pageEditTitle', helper::FILTER_ID, true); $pageId = $this->getInput('pageEditTitle', helper::FILTER_ID, true);
// un dossier existe du même nom (erreur en cas de redirection)
if (file_exists($pageId)) {
$pageId = 'p-' . $pageId;
}
// Si l'id a changée // Si l'id a changée
if ($pageId !== $this->getUrl(2)) { if ($pageId !== $this->getUrl(2)) {
// Incrémente le nouvel id de la page // Incrémente le nouvel id de la page

View File

@ -1 +1 @@
[{"title":"Accueil","value":"?accueil","menu":[{"title":"Enfant","value":"?enfant"},{"title":"Mise en page","value":"?mise-en-page"}]},{"title":"Priv\u00e9e","value":"?privee"},{"title":"Blog","value":"?blog"},{"title":"Galeries","value":"?galeries"},{"title":"Site de Zwii","value":"?site-de-zwii"},{"title":"Contact","value":"?contact"}] [{"title":"Nouvelle page","value":"?nouvelle-page"},{"title":"Nouvelle page","value":"?nouvelle-page-2"},{"title":"Accueil","value":"?accueil-2"},{"title":"Priv\u00e9e","value":"?privee"},{"title":"Blog","value":"?blog"},{"title":"Galeries","value":"?galeries"},{"title":"Site de Zwii","value":"?site-de-zwii"},{"title":"Contact","value":"?p-contact"},{"title":"Accueil","value":"?accueil","menu":[{"title":"Enfant","value":"?enfant"},{"title":"Mise en page","value":"?mise-en-page"}]}]