Skip to content

Commit

Permalink
fix for default siteaccess on 5.x sites
Browse files Browse the repository at this point in the history
  • Loading branch information
dbroadfoot committed Jul 11, 2013
1 parent 9d9ee67 commit 64cc190
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/sitelink.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ function hyperlink(&$operatorValue=false, $host=false){
'path'=>preg_replace('/^([^\/].*)|^$/','/$1',preg_replace('/^'.str_replace('/','\\/',$this->pathPrefix).'\/*/','/',$this->urlComponents['path'])),
'user_parameters'=>$this->parameters['user_parameters']?$this->parameters['user_parameters']:$this->urlComponents['user_parameters']
));
$ini = eZINI::instance();
if($this->useSiteaccessOverride && isset($this->useSiteaccess)){
$urlComponents['path']='/'.$this->useSiteaccess.$urlComponents['path'];
} else if($this->siteAccess && isset($this->siteAccess['uri_part']) && count($this->siteAccess['uri_part']) && !$urlComponents['host']){
} else if($this->siteAccess && isset($this->siteAccess['uri_part']) && count($this->siteAccess['uri_part']) && !$urlComponents['host'] && $ini->variable('SiteSettings', 'DefaultAccess') != $this->siteAccess['uri_part'][0]){
$siteaccess_check = str_replace("//", "/", '/'.$urlComponents['path'].'/');
if(stripos($siteaccess_check,'/'.implode('/',$this->siteAccess['uri_part']).'/')!==0){
$urlComponents['path']='/'.implode('/',$this->siteAccess['uri_part']).$urlComponents['path'];
Expand Down

0 comments on commit 64cc190

Please sign in to comment.