1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

staticUrl() to always returns a full path.

This commit is contained in:
Cameron
2020-12-03 10:31:19 -08:00
parent f621aeaa56
commit 69cb52e848
3 changed files with 9 additions and 10 deletions

View File

@@ -2159,7 +2159,9 @@ class e107
$tp = self::getParser(); $tp = self::getParser();
$libraryPath = $tp->replaceConstants($info['library_path'].'/'.$info['path'], 'abs').'/'; $libraryPath = $info['library_path'].'/'.$info['path'].'/';
foreach($info['preload'] as $pre) foreach($info['preload'] as $pre)
{ {

View File

@@ -2713,13 +2713,11 @@ class e_parse extends e_parser
/** /**
* @todo Move to e107_class ? * @todo Move to e107_class ?
* @param string $path - absolute path * @param string $path - absolute path or e107 path {e_PLUGIN} etc.
* @return string - static path. * @return string - full path or static path.
*/ */
public function staticUrl($path=null, $opts=array()) public function staticUrl($path=null, $opts=array())
{ {
$path = $this->replaceConstants($path,'abs');
if(!defined('e_HTTP_STATIC') || deftrue('e_ADMIN_AREA')) if(!defined('e_HTTP_STATIC') || deftrue('e_ADMIN_AREA'))
{ {
// e107::getDebug()->log("e_HTTP_STATIC not defined"); // e107::getDebug()->log("e_HTTP_STATIC not defined");
@@ -2729,11 +2727,10 @@ class e_parse extends e_parser
} }
else else
{ {
return $path; return self::replaceConstants($path, 'full');
} }
} }
$staticArray = e_HTTP_STATIC; $staticArray = e_HTTP_STATIC;
if(is_array($staticArray)) if(is_array($staticArray))
@@ -2763,8 +2760,9 @@ class e_parse extends e_parser
$base = ''; $base = '';
$path = self::replaceConstants($path, 'abs'); // replace any {THEME} etc.
$srch = array( $srch = array(
//
e_PLUGIN_ABS, e_PLUGIN_ABS,
e_THEME_ABS, e_THEME_ABS,
e_WEB_ABS, e_WEB_ABS,
@@ -2773,7 +2771,6 @@ class e_parse extends e_parser
$repl = array( $repl = array(
$http.$base.e107::getFolder('plugins'), $http.$base.e107::getFolder('plugins'),
$http.$base.e107::getFolder('themes'), $http.$base.e107::getFolder('themes'),
$http.$base.e107::getFolder('web'), $http.$base.e107::getFolder('web'),

View File

@@ -4,7 +4,7 @@ if(e_ADMIN_AREA !==true)
{ {
e107::css('social', 'css/fontello.css'); e107::css('social', 'css/fontello.css');
e107::link(array('rel'=>'preload', 'href'=> e_PLUGIN_ABS."social/font/fontello.woff2?21917124", 'as' => "font", 'type'=>"font/woff2", 'crossorigin' => true)); e107::link(array('rel'=>'preload', 'href'=> "{e_PLUGIN}social/font/fontello.woff2?21917124", 'as' => "font", 'type'=>"font/woff2", 'crossorigin' => true));
e107::css('social' ,'css/social.css'); e107::css('social' ,'css/social.css');
$appID = false; $appID = false;