Skip to content

Commit

Permalink
Fix EZP-23822: PathPrefix still present when using ezpLanguageSwitcher
Browse files Browse the repository at this point in the history
Languageswitcher redirection special case when redirecting to the value of pathprefix (mysite.com/myPathPrefix)

EzpLanguageSwitcher: Removing unrelevant params

Adding extra spaces
  • Loading branch information
Yann Weyer committed Dec 19, 2014
1 parent e2c040a commit e2888c7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions kernel/private/classes/ezplanguageswitcher.php
Expand Up @@ -51,7 +51,6 @@ function __construct( $params = null )
/**
* Get instance siteaccess specific site.ini
*
* @param string $sa
* @return void
*/
protected function getSiteAccessIni()
Expand Down Expand Up @@ -142,7 +141,7 @@ protected static function removePathPrefixIfNeeded( eZINI $saIni, &$url )
$pathPrefix = $saIni->variable( 'SiteAccessSettings', 'PathPrefix' );
if ( !empty( $pathPrefix ) )
{
if ( strpos( $url, $pathPrefix . '/' ) === 0 )
if ( ( strpos( $url, $pathPrefix . '/' ) === 0 ) || ( $pathPrefix === $url ) )
{
$url = substr( $url, strlen( $pathPrefix ) + 1 );
}
Expand All @@ -159,8 +158,6 @@ protected static function removePathPrefixIfNeeded( eZINI $saIni, &$url )
/**
* Returns URL alias for the specified <var>$locale</var>
*
* @param string $url
* @param string $locale
* @return void
*/
public function destinationUrl()
Expand Down

0 comments on commit e2888c7

Please sign in to comment.