mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merging fixes and enhancements into trunk.
Revision: [2046] One last refactoring of Dispatcher git-svn-id: https://svn.cakephp.org/repo/trunk/cake@2047 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
528d0e837f
commit
9be62bcb7e
2 changed files with 13 additions and 5 deletions
|
@ -6,4 +6,4 @@
|
|||
// +---------------------------------------------------------------------------------------------------+ //
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
0.10.8.2045
|
||||
0.10.8.2047
|
|
@ -345,7 +345,7 @@ class Dispatcher extends Object
|
|||
*
|
||||
* @return string Base URL
|
||||
*/
|
||||
function baseUrl()
|
||||
function baseUrl()
|
||||
{
|
||||
$htaccess = null;
|
||||
$base = $this->admin;
|
||||
|
@ -373,13 +373,21 @@ function baseUrl()
|
|||
{
|
||||
if (defined('BASE_URL'))
|
||||
{
|
||||
$webroot =setUri();
|
||||
$webroot = setUri();
|
||||
$htaccess = preg_replace('/(?:'.APP_DIR.'(.*)|index\\.php(.*))/i', '', $webroot).APP_DIR.'/'.WEBROOT_DIR.'/';
|
||||
}
|
||||
if (preg_match('/^(.*)\\/'.APP_DIR.'\\/'.WEBROOT_DIR.'\\/index\\.php$/', $scriptName, $regs))
|
||||
{
|
||||
!empty($htaccess)? $this->webroot = $htaccess : $this->webroot = $regs[1].'/'.APP_DIR.'/';
|
||||
return $base.$regs[1].'/'.APP_DIR;
|
||||
if(APP_DIR === 'app')
|
||||
{
|
||||
$appDir = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$appDir = '/'.APP_DIR;
|
||||
}
|
||||
!empty($htaccess)? $this->webroot = $htaccess : $this->webroot = $regs[1].$appDir.'/';
|
||||
return $base.$regs[1].$appDir;
|
||||
}
|
||||
elseif (preg_match('/^(.*)\\/'.WEBROOT_DIR.'([^\/i]*)|index\\\.php$/', $scriptName, $regs))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue