Skip to content

Commit

Permalink
Fixed bug when in Relax mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Ghita committed Nov 8, 2012
1 parent 0301844 commit 55a139f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/class.PLHManagerURL.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public static function lang2sym($url, $lang_code = null){
*/
private static function _setLangCode(&$lang_code){
if( empty($lang_code) || (FLang::validateLangCode($lang_code) === false ) ){

$lang_code = FLang::getMainLang();
}
}
Expand Down Expand Up @@ -145,7 +144,7 @@ private static function _processURL($url, $ref_handle, $target_handle){
}
}

return (string)$path.'/'.$url_query.$url_hash;
return (string) trim($path.'/'.$url_query.$url_hash, '/');
}

/**
Expand All @@ -162,11 +161,10 @@ private static function _processURL($url, $ref_handle, $target_handle){
*/
private static function _processRelax($old_url, $ref_handle, $target_handle){
$path = '';
$last_parent = null;

foreach( $old_url as $value ){
if( !empty($value) ){
$last_parent = null;

$query = sprintf(
"SELECT `id`, `%s`, `parent` FROM `tbl_pages` WHERE `%s` = '%s' LIMIT 1",
$target_handle, $ref_handle, $value
Expand Down

0 comments on commit 55a139f

Please sign in to comment.