mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
fix Framework::includeJS("", "app", "filemanager") failed on client-side, due to a double slash "//" in path
also fixed various warnings
This commit is contained in:
parent
cc72c6ff60
commit
e184d5bdcd
@ -1510,7 +1510,7 @@ abstract class Framework extends Framework\Extra
|
||||
static function includeJS($package, $file=null, $app='api', $append=true)
|
||||
{
|
||||
// prefer app.min.js over old, pre RollupJS app.js
|
||||
if ($package[0] === '/' && substr($package, -7) === '/app.js' &&
|
||||
if ($package && $package[0] === '/' && substr($package, -7) === '/app.js' &&
|
||||
self::$js_include_mgr->include_js_file(substr($package, 0, -3).'.min.js', $file, $app, $append) ||
|
||||
$file === 'app' && self::$js_include_mgr->include_js_file($package, 'app.min', $app, $append))
|
||||
{
|
||||
|
@ -314,10 +314,10 @@ class IncludeMgr
|
||||
*/
|
||||
private function translate_params($package, $file=null, $app='api')
|
||||
{
|
||||
if ($package[0] == '/' && is_readable(EGW_SERVER_ROOT.parse_url($path = $package, PHP_URL_PATH)) ||
|
||||
if ($package && $package[0] == '/' && is_readable(EGW_SERVER_ROOT.parse_url($path = $package, PHP_URL_PATH)) ||
|
||||
// fix old /phpgwapi/js/ path by replacing it with /api/js/
|
||||
substr($package, 0, 13) == '/phpgwapi/js/' && is_readable(EGW_SERVER_ROOT.parse_url($path = str_replace('/phpgwapi/js/', '/api/js/', $package), PHP_URL_PATH)) ||
|
||||
$package[0] == '/' && is_readable(EGW_SERVER_ROOT.($path = $package)) ||
|
||||
$package && $package[0] == '/' && is_readable(EGW_SERVER_ROOT.($path = $package)) ||
|
||||
$package == '.' && is_readable(EGW_SERVER_ROOT.($path="/$app/js/$file.js")) ||
|
||||
is_readable(EGW_SERVER_ROOT.($path="/$app/js/$package/$file.js")) ||
|
||||
// fix not found by using app='api'
|
||||
@ -325,7 +325,7 @@ class IncludeMgr
|
||||
$app != 'phpgwapi' && is_readable(EGW_SERVER_ROOT.($path="/phpgwapi/js/$package/$file.js")))
|
||||
{
|
||||
// normalise /./ to /
|
||||
$path = str_replace('/./', '/', $path);
|
||||
$path = str_replace(['/./', '//'], '/', $path);
|
||||
|
||||
// Handle the special case, that the file is an url - in this case
|
||||
// we will do no further processing but just include the file
|
||||
|
Loading…
Reference in New Issue
Block a user