diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index cf6082f3bd8..357c050afd5 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -61,7 +61,7 @@ function dolSavePageAlias($filealias, $object, $objectpage) global $conf; // Now create the .tpl file (duplicate code with actions updatesource or updatecontent but we need this to save new header) - dol_syslog("We regenerate the alias page filealias=".$filealias); + dol_syslog("dolSavePageAlias We regenerate the alias page filealias=".$filealias); $aliascontent = 'website->dir_output.'/'.$object->ref.'/'.trim($aliasshortcuttocreate).'.php'; - dolSavePageAlias($filealias, $object, $objectpagestatic); + if (trim($aliasshortcuttocreate)) + { + $filealias=$conf->website->dir_output.'/'.$object->ref.'/'.trim($aliasshortcuttocreate).'.php'; + dolSavePageAlias($filealias, $object, $objectpagestatic); + } } } } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 46121913c2b..273e74858ce 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1393,8 +1393,11 @@ if ($action == 'updatemeta') { foreach($tmpaltaliases as $tmpaliasalt) { - $result=dolSavePageAlias($pathofwebsite.'/'.trim($tmpaliasalt).'.php', $object, $objectpage); - if (! $result) setEventMessages('Failed to write file '.$pathofwebsite.'/'.trim($tmpaliasalt).'.php', null, 'errors'); + if (trim($tmpaliasalt)) + { + $result=dolSavePageAlias($pathofwebsite.'/'.trim($tmpaliasalt).'.php', $object, $objectpage); + if (! $result) setEventMessages('Failed to write file '.$pathofwebsite.'/'.trim($tmpaliasalt).'.php', null, 'errors'); + } } } }