29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-29 16:43:42 +00:00

Fixed [#5430] _parseApplicationRoute() removing too much of route on match

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@8271 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
This commit is contained in:
Johan Janssens 2007-07-31 22:28:49 +00:00
parent 96fd2259ce
commit 9153a57baa
5 changed files with 20 additions and 28 deletions

View File

@ -38,7 +38,11 @@ Legend:
! -> Note
01-August-2007 Andrew Eddie
^ Turned down error handling in JSimpleXML to raiseWarning instead of raiseError - makes it easier find what happened
^ Turned down error handling in JSimpleXML to raiseWarning instead of raiseError -
makes it easier find what happened
31-July-2007 Johan Janssens
# Fixed [#5430] _parseApplicationRoute() removing too much of route on match
31-July-2007 Robin Muilwijk
# Fixed [#6275] incorrect prefix for sample data, changed jos_ to #__

View File

@ -43,14 +43,10 @@ class JRouterAdministrator extends JObject
* @return string The absolute search engine friendly URL
* @since 1.5
*/
function build($url, $xhtml = true)
function build($url)
{
$url = str_replace('&', '&', $url);
if($xhtml) {
$url = str_replace( '&', '&', $url );
}
return $url;
}
}

View File

@ -206,9 +206,11 @@ class JRouterSite extends JRouter
foreach ($items as $item)
{
if(strlen($item->route) > 0 && strpos($url.'/', $item->route.'/') === 0)
$lenght = strlen($item->route); //get the lenght of the route
if($lenght > 0 && strpos($url.'/', $item->route.'/') === 0)
{
$url = str_replace($item->route, '', $url);
$url = substr($url, $lenght);
$itemid = $item->id;
$option = $item->component;
@ -264,11 +266,10 @@ class JRouterSite extends JRouter
* Function to convert an internal URI to a route
*
* @param string $string The internal URL
* @param boolean $xhtml Replace & by & for xml compilance
* @return string The absolute search engine friendly URL
* @since 1.5
*/
function build($url, $xhtml = true)
function build($url)
{
// Replace all & with & - ensures cache integrity
$url = str_replace('&', '&', $url);
@ -289,7 +290,7 @@ class JRouterSite extends JRouter
}
// Decompose link into url component parts
$uri =& JURI::getInstance(JURI::base().$url);
$uri = JURI::getInstance(JURI::base().$url);
$menu =& JMenu::getInstance();
/*
@ -367,10 +368,6 @@ class JRouterSite extends JRouter
}
}
if($xhtml) {
$url = str_replace( '&', '&', $url );
}
return $url;
}

View File

@ -43,14 +43,10 @@ class JRouterInstallation extends JObject
* @return string The absolute search engine friendly URL
* @since 1.5
*/
function build($url, $xhtml = true)
function build($url)
{
$url = str_replace('&', '&', $url);
if($xhtml) {
$url = str_replace( '&', '&', $url );
}
return $url;
}
}

View File

@ -46,7 +46,7 @@ class JRoute
$router =& $mainframe->getRouter();
// Build route
$url = $router->build($url, $xhtml);
$url = $router->build($url);
/*
* Get the secure/unsecure URLs.
@ -78,6 +78,10 @@ class JRoute
if ($ssl == -1) {
$url = $unsecure.$url;
}
if($xhtml) {
$url = str_replace( '&', '&', $url );
}
return $url;
}
@ -137,18 +141,13 @@ class JRouter extends JObject
* Function to convert an internal URI to a route
*
* @param string $string The internal URL
* @param boolean $xhtml Replace & by & for xml compilance
* @return string The absolute search engine friendly URL
* @since 1.5
*/
function build($url, $xhtml = true)
function build($url)
{
$url = str_replace('&', '&', $url);
if($xhtml) {
$url = str_replace( '&', '&', $url );
}
return $url;
}