fix Scrutinizer "bugs"

This commit is contained in:
Ralf Becker 2016-07-02 12:26:39 +02:00
parent b0803c76b6
commit 01659d13c9

View File

@ -474,9 +474,8 @@ switch($cmd)
*/ */
function load_wrapper($url) function load_wrapper($url)
{ {
$scheme = parse_url($url,PHP_URL_SCHEME); if (($scheme = parse_url($url,PHP_URL_SCHEME)) &&
!in_array($scheme, stream_get_wrappers()))
if (!in_array($scheme,stream_get_wrappers()))
{ {
switch($scheme) switch($scheme)
{ {
@ -484,15 +483,15 @@ function load_wrapper($url)
case 'webdavs': case 'webdavs':
require_once('HTTP/WebDAV/Client.php'); require_once('HTTP/WebDAV/Client.php');
break; break;
case '': // default scheme is file and always available
break;
default: default:
if (!isset($GLOBALS['egw']) && !in_array($scheme,array('smb','imap'))) if (!isset($GLOBALS['egw']) && !in_array($scheme,array('smb','imap')) &&
($user = parse_url($url,PHP_URL_USER)) && ($pass = parse_url($url,PHP_URL_PASS)))
{ {
load_egw(parse_url($url,PHP_URL_USER), parse_url($url,PHP_URL_PASS), parse_url($url,PHP_URL_HOST)); load_egw($user, $pass, ($host = parse_url($url,PHP_URL_HOST)) ? $host : 'default');
} }
// get eGW's __autoload() function // get eGW's __autoload() function
include_once(EGW_API_INC.'/common_functions.inc.php'); include_once(EGW_SERVER_ROOT.'/api/src/loader/common.php');
if (!Vfs::load_wrapper($scheme)) if (!Vfs::load_wrapper($scheme))
{ {