minor changes

This commit is contained in:
Diego Najar 2017-05-08 22:01:16 +02:00
parent d3d19f5109
commit 2a47beeae4
1 changed files with 4 additions and 7 deletions

View File

@ -275,11 +275,9 @@ class dbPages extends dbJSON
$newKey = Text::cleanUrl($parent).'/'.Text::cleanUrl($text); $newKey = Text::cleanUrl($parent).'/'.Text::cleanUrl($text);
} }
if($newKey!==$oldKey) if($newKey!==$oldKey) {
{ // Verify if the key is already been used
// Verify if the key is already been used. if( isset($this->db[$newKey]) ) {
if( isset($this->db[$newKey]) )
{
if( !Text::endsWithNumeric($newKey) ) { if( !Text::endsWithNumeric($newKey) ) {
$newKey = $newKey.'-0'; $newKey = $newKey.'-0';
} }
@ -290,8 +288,7 @@ class dbPages extends dbJSON
} }
} }
if($returnSlug) if($returnSlug) {
{
$explode = explode('/', $newKey); $explode = explode('/', $newKey);
if(isset($explode[1])) { if(isset($explode[1])) {