29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-27 07:33:41 +00:00

Fixed issue [#20662] Joomla home page doesn't work from anything except index.php (Jeff Booher, Louis Landry).

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@18468 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
This commit is contained in:
Andrew Eddie 2010-08-16 07:32:27 +00:00
parent b199b465ad
commit 1b56b2f95e
2 changed files with 20 additions and 7 deletions

View File

@ -39,10 +39,28 @@ class JRouterSite extends JRouter
$app->redirect((string)$uri);
}
// Get the path
$path = $uri->getPath();
// Remove the base URI path.
$path = substr_replace($path, '', 0, strlen(JURI::base(true)));
// Check to see if a request to a specific entry point has been made.
if (preg_match("#.*\.php#u", $path, $matches)) {
// Get the current entry point path relative to the site path.
$scriptPath = realpath($_SERVER['SCRIPT_FILENAME'] ? $_SERVER['SCRIPT_FILENAME'] : str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']));
$relativeScriptPath = str_replace('\\', '/', str_replace(JPATH_SITE, '', $scriptPath));
// If a php file has been found in the request path, check to see if it is a valid file.
// Also verify that it represents the same file from the server variable for entry script.
if (file_exists(JPATH_SITE.$matches[0]) && ($matches[0] == $relativeScriptPath)) {
// Remove the entry point segments from the request path for proper routing.
$path = str_replace($matches[0], '', $path);
}
}
//Remove the suffix
if ($this->_mode == JROUTER_MODE_SEF) {
if ($app->getCfg('sef_suffix') && !(substr($path, -9) == 'index.php' || substr($path, -1) == '/')) {
@ -53,12 +71,6 @@ class JRouterSite extends JRouter
}
}
//Remove basepath
$path = substr_replace($path, '', 0, strlen(JURI::base(true)));
//Remove prefix
$path = str_replace('index.php', '', $path);
//Set the route
$uri->setPath(trim($path , '/'));

View File

@ -40,6 +40,7 @@ $ -> Language fix or change
# Fixed issue [#21227] com_menus don't bind the request data into fields that has multiple="true" (Jonnathan S. Lima, Louis Landry).
# Fixed issue [#21772] Joomla! doesn't play nicely with other frameworks (Samuel Moffatt).
# Fixed issue [#21853] Add featured view to com_contacts (like com_content) or just toggle (Roland Dalmulder, Jean-Marie Simonet).
# Fixed issue [#20662] Joomla home page doesn't work from anything except index.php (Jeff Booher, Louis Landry).
15-Aug-2010 Mark Dexter
# [#21558] Feed datetime formats are invalid