Dev13 bug de la redirection

This commit is contained in:
fredtempez 2019-02-20 12:38:20 +01:00
parent 510dae5671
commit 29493c6319
2 changed files with 10 additions and 6 deletions

View File

@ -28,7 +28,7 @@ class common {
const GROUP_ADMIN = 3;
// Numéro de version de développement :/
// Désactive l'update auto
const ZWII_VERSION = '9.0.00-dev12';
const ZWII_VERSION = '9.0.00-dev13';
// Numéro de version stable
//const ZWII_VERSION = '9.0.00';
@ -1775,6 +1775,10 @@ class helper {
if(intval($text) !== 0) {
$text = 'i' . $text;
}
// un dossier existe du même nom (erreur en cas de redirection)
if (file_exists($text)) {
$text = 'p-' . $text;
}
break;
case self::FILTER_INT:
$text = (int) filter_var($text, FILTER_SANITIZE_NUMBER_INT);

View File

@ -160,14 +160,14 @@ class page extends common {
// La page existe
else {
// Soumission du formulaire
if($this->isPost()) {
if($this->isPost()) {
$pageId = $this->getInput('pageEditTitle', helper::FILTER_ID, true);
// Si l'id a changée
if($pageId !== $this->getUrl(2)) {
if ($pageId !== $this->getUrl(2)) {
// Incrémente le nouvel id de la page
$pageId = helper::increment($pageId, $this->getData(['page']));
$pageId = helper::increment($pageId, self::$coreModuleIds);
$pageId = helper::increment($pageId, self::$moduleIds);
$pageId = helper::increment($pageId, $this->getData(['page']));
$pageId = helper::increment($pageId, self::$coreModuleIds);
$pageId = helper::increment($pageId, self::$moduleIds);
// Met à jour les enfants
foreach($this->getHierarchy($this->getUrl(2)) as $childrenPageId) {
$this->setData(['page', $childrenPageId, 'parentPageId', $pageId]);