Skip to content

Commit

Permalink
Поправка във функцията getBoot();
Browse files Browse the repository at this point in the history
  • Loading branch information
milengg committed Nov 10, 2018
1 parent 8299c0c commit ea157c7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 22 deletions.
20 changes: 10 additions & 10 deletions core/App.class.php
Expand Up @@ -918,10 +918,6 @@ public static function toUrl($params = array(), $type = null, $protect = true, $

// Зпочваме подготовката на URL-то

if (EF_APP_NAME_FIXED !== true) {
$pre = '/' . ($params['App'] ? $params['App'] : EF_APP_NAME);
}

// Махаме префикса на пакета по подразбиране
$appPref = EF_APP_CODE_NAME . '_';

Expand Down Expand Up @@ -988,22 +984,22 @@ public static function toUrl($params = array(), $type = null, $protect = true, $
}

$pre = rtrim($pre, '/');

switch ($type) {
case 'local':
$url = ltrim($pre . $urlQuery, '/');
break;

case 'relative':
$url = rtrim(static::getBoot(false), '/') . $pre . $urlQuery;
$url = rtrim(static::getBoot(false, false, true), '/') . $pre . $urlQuery;
break;

case 'absolute':
$url = rtrim(static::getBoot(true), '/') . $pre . $urlQuery;
$url = rtrim(static::getBoot(true, false, true), '/') . $pre . $urlQuery;
break;

case 'absolute-force':
$url = rtrim(static::getBoot(true, true), '/') . $pre . $urlQuery;
$url = rtrim(static::getBoot(true, true, true), '/') . $pre . $urlQuery;
break;
}

Expand Down Expand Up @@ -1032,7 +1028,7 @@ public static function getSelfURL()
*
* @return string
*/
public static function getBoot($absolute = false, $forceHttpHost = false)
public static function getBoot($absolute = false, $forceHttpHost = false, $addAppName = false)
{
static $relativeWebRoot = null;

Expand Down Expand Up @@ -1073,7 +1069,11 @@ public static function getBoot($absolute = false, $forceHttpHost = false)
}

$boot = rtrim($boot, '/');


if (EF_APP_NAME_FIXED !== true && $addAppName) {
$boot .= '/' . (Request::get('App') ? Request::get('App') : EF_APP_NAME);
}

return $boot;
}

Expand Down
4 changes: 2 additions & 2 deletions core/boot.inc.php
Expand Up @@ -455,9 +455,9 @@ function toLocalUrl($arr)
*
* Псевдоним на @link core_App::getBoot()
*/
function getBoot($absolute = false)
function getBoot($absolute = false, $forceHttpHost = false, $addAppName = false)
{
return core_App::getBoot($absolute);
return core_App::getBoot($absolute, $forceHttpHost, $addAppName);
}


Expand Down
4 changes: 2 additions & 2 deletions core/page/Active.class.php
Expand Up @@ -42,7 +42,7 @@ public function __construct()
jquery_Jquery::enable($this);
$this->push('js/efCommon.js', 'JS');
$this->push('js/overthrow-detect.js', 'JS');
$this->appendOnce("\n<link rel=\"shortcut icon\" href=\"" . getBoot(true) . '/favicon.ico"' . ' type="image/x-icon">', 'HEAD');

$this->appendOnce("\n<link rel=\"shortcut icon\" href=\"" . getBoot(true, true, true) . '/favicon.ico"' . ' type="image/x-icon">', 'HEAD');
}
}
2 changes: 1 addition & 1 deletion page/External.class.php
Expand Up @@ -28,7 +28,7 @@ public function __construct()
$this->push('css/Application.css', 'CSS');
jquery_Jquery::enable($this);
$this->push('js/efCommon.js', 'JS');
$this->appendOnce("\n<link rel=\"shortcut icon\" href=\"" . getBoot(true) . '/favicon.ico"' . '>', 'HEAD');
$this->appendOnce("\n<link rel=\"shortcut icon\" href=\"" . '' . '/favicon.ico"' . '>', 'HEAD');
$this->prepend($conf->EF_APP_TITLE, 'PAGE_TITLE');

$this->replace(new ET("<div class='external'>[#PAGE_CONTENT#]</div>"), 'PAGE_CONTENT');
Expand Down
2 changes: 1 addition & 1 deletion page/Print.class.php
Expand Up @@ -48,7 +48,7 @@ public function __construct()
jquery_Jquery::enable($this);
$this->push('js/efCommon.js', 'JS');

$this->appendOnce("\n<link rel=\"shortcut icon\" href=\"" . getBoot(true) . '/favicon.ico"' . ' type="image/x-icon">', 'HEAD');
$this->appendOnce("\n<link rel=\"shortcut icon\" href=\"" . getBoot(true, true, true) . '/favicon.ico"' . ' type="image/x-icon">', 'HEAD');

$this->prepend($conf->EF_APP_TITLE, 'PAGE_TITLE');

Expand Down
7 changes: 1 addition & 6 deletions type/Richtext.class.php
Expand Up @@ -981,12 +981,7 @@ public function _catchLink($match)
// Ако нямаме схема на URL-то
if (!preg_match("/^[a-z0-9]{0,12}\:\/\//i", $url)) {
if ($url{0} == '/') {
$httpBoot = getBoot(true);
if (EF_APP_NAME_FIXED !== true) {
$app = Request::get('App');
$httpBoot .= '/' . ($app ? $app : EF_APP_NAME);
}

$httpBoot = getBoot(true, false, true);
$url = $httpBoot . $url;
} else {
$url = "http://{$url}";
Expand Down

0 comments on commit ea157c7

Please sign in to comment.