From 34a551c909247a47ee6762abb9feec1c4d0a4e18 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 10 Jun 2016 08:33:39 -0700 Subject: [PATCH] Issue #1698 - Admin Sitelinks relative URL issue. - display mode fix. --- e107_admin/links.php | 18 +++++++----------- e107_handlers/e107_class.php | 4 ++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/e107_admin/links.php b/e107_admin/links.php index 06a6aab0a..f43ef9902 100644 --- a/e107_admin/links.php +++ b/e107_admin/links.php @@ -692,15 +692,9 @@ class links_admin_form_ui extends e_admin_form_ui { $linkUrl = $this->getController()->getListModel()->get('link_url'); - /* -*/ - - // - - - $url = $this->link_url($linkUrl,$mode); + $url = $this->link_url($linkUrl,'link_id'); @@ -746,23 +740,25 @@ class links_admin_form_ui extends e_admin_form_ui function link_url($curVal,$mode) { - if($mode == 'read') + if($mode == 'read' || $mode == 'link_id') // read = display mode, link_id = actual absolute URL { $owner = $this->getController()->getListModel()->get('link_owner'); $sef = $this->getController()->getListModel()->get('link_sefurl'); - if($curVal[0] !== '{' && substr($curVal,0,4) != 'http') + if($curVal[0] !== '{' && substr($curVal,0,4) != 'http' && $mode == 'link_id') { $curVal = '{e_BASE}'.$curVal; } if(!empty($owner) && !empty($sef)) { - $curVal = e107::url($owner,$sef, null); + $opt = ($mode == 'read') ? array('mode'=>'raw') : array(); + $curVal = e107::url($owner,$sef, null, $opt); } else { - $curVal = e107::getParser()->replaceConstants($curVal,'abs'); + $opt = ($mode == 'read') ? 'rel' : 'abs'; + $curVal = e107::getParser()->replaceConstants($curVal,$opt); } e107::getDebug()->log($curVal); diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 214ea556d..bdafa7ce2 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -2942,6 +2942,10 @@ class e107 { $sefUrl = SITEURL.$rawUrl; } + elseif($options['mode'] == 'raw') + { + $sefUrl = $rawUrl; + } else { $sefUrl = e_HTTP.$rawUrl;