From 93bc0feb16a8fe3723648bf027d0fc073607f750 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 18 Oct 2014 12:17:17 +0000 Subject: [PATCH] * Filemanager: fix since PHP 5.5.18 not longer working non-ascii chars in filenames, eg. German umlauts or accents --- etemplate/inc/class.vfs_widget.inc.php | 2 +- filemanager/cli.php | 20 +++++++++---------- .../inc/class.filemanager_admin.inc.php | 2 +- filemanager/inc/class.filemanager_ui.inc.php | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/etemplate/inc/class.vfs_widget.inc.php b/etemplate/inc/class.vfs_widget.inc.php index a69b1ba122..948c11b609 100644 --- a/etemplate/inc/class.vfs_widget.inc.php +++ b/etemplate/inc/class.vfs_widget.inc.php @@ -327,7 +327,7 @@ class vfs_widget { if (substr($path,0,6) == '/apps/') { - $path = parse_url(egw_vfs::resolve_url_symlinks($path),PHP_URL_PATH); + $path = egw_vfs::parse_url(egw_vfs::resolve_url_symlinks($path),PHP_URL_PATH); } //Assemble the thumbnail parameters diff --git a/filemanager/cli.php b/filemanager/cli.php index 5b71190eac..3cfbd01d34 100755 --- a/filemanager/cli.php +++ b/filemanager/cli.php @@ -337,7 +337,7 @@ switch($cmd) $mode = $url; // first param is mode $url = array_shift($argv); } - if (parse_url($url,PHP_URL_SCHEME)) load_wrapper($url); // cant use stat or egw_vfs::mode2int otherwise! + if (egw_vfs::parse_url($url,PHP_URL_SCHEME)) load_wrapper($url); // cant use stat or egw_vfs::mode2int otherwise! if (strpos($mode,'+') !== false || strpos($mode,'-') !== false) { @@ -362,7 +362,7 @@ switch($cmd) { $owner = $url; // first param is owner/group $url = array_shift($argv); - if (parse_url($url,PHP_URL_SCHEME)) load_wrapper($url); // we need the header loaded + if (egw_vfs::parse_url($url,PHP_URL_SCHEME)) load_wrapper($url); // we need the header loaded if ($owner == 'root') { $owner = 0; @@ -388,7 +388,7 @@ switch($cmd) $params = array($url,$owner); break; } - if (($scheme = parse_url($url,PHP_URL_SCHEME))) + if (($scheme = egw_vfs::parse_url($url,PHP_URL_SCHEME))) { load_wrapper($url); } @@ -418,7 +418,7 @@ switch($cmd) { if ($argc) { - if (!($name = basename(parse_url($url,PHP_URL_PATH)))) $name = '/'; + if (!($name = basename(egw_vfs::parse_url($url,PHP_URL_PATH)))) $name = '/'; echo "\n$name:\n"; } // separate evtl. query part, to re-add it after the file-name @@ -446,7 +446,7 @@ switch($cmd) { if ($argc) { - echo "\n".basename(parse_url($url,PHP_URL_PATH)).":\n"; + echo "\n".basename(egw_vfs::parse_url($url,PHP_URL_PATH)).":\n"; } fpassthru($f); fclose($f); @@ -469,7 +469,7 @@ switch($cmd) */ function load_wrapper($url) { - $scheme = parse_url($url,PHP_URL_SCHEME); + $scheme = egw_vfs::parse_url($url,PHP_URL_SCHEME); if (!in_array($scheme,stream_get_wrappers())) { @@ -484,7 +484,7 @@ function load_wrapper($url) default: if (!isset($GLOBALS['egw']) && !in_array($scheme,array('smb','imap'))) { - load_egw(parse_url($url,PHP_URL_USER),parse_url($url,PHP_URL_PASS),parse_url($url,PHP_URL_HOST)); + load_egw(egw_vfs::parse_url($url,PHP_URL_USER),egw_vfs::parse_url($url,PHP_URL_PASS),egw_vfs::parse_url($url,PHP_URL_HOST)); } // get eGW's __autoload() function include_once(EGW_API_INC.'/common_functions.inc.php'); @@ -642,7 +642,7 @@ function do_eacl(array $argv) function do_stat($url,$long=false,$numeric=false,$full_path=false,$inode=false) { //echo "do_stat($url,$long,$numeric,$full_path)\n"; - $bname = parse_url($url,PHP_URL_PATH); + $bname = egw_vfs::parse_url($url,PHP_URL_PATH); if (!$full_path) { @@ -761,7 +761,7 @@ function _cp($from,$to,$verbose=false,$perms=false) if (is_dir($to) || !file_exists($to) && is_dir($from) && $mkdir) { - $path = parse_url($from,PHP_URL_PATH); + $path = egw_vfs::parse_url($from,PHP_URL_PATH); if (is_dir($to)) { list($to,$query) = explode('?',$to,2); @@ -841,7 +841,7 @@ function do_lntree($from,$to) function _ln($src, $base, $stat) { //echo "_ln('$src', '$base', ".array2string($stat).")\n"; - $dst = $base.parse_url($src, PHP_URL_PATH); + $dst = $base.egw_vfs::parse_url($src, PHP_URL_PATH); if (is_link($src)) { diff --git a/filemanager/inc/class.filemanager_admin.inc.php b/filemanager/inc/class.filemanager_admin.inc.php index 9941f8ad71..8ceae6b71b 100644 --- a/filemanager/inc/class.filemanager_admin.inc.php +++ b/filemanager/inc/class.filemanager_admin.inc.php @@ -178,7 +178,7 @@ class filemanager_admin extends filemanager_ui 'url' => $url, ); $readonlys["disable[$path]"] = !$this->versioning || !egw_vfs::$is_root || - parse_url($url,PHP_URL_SCHEME) != $this->versioning; + egw_vfs::parse_url($url,PHP_URL_SCHEME) != $this->versioning; } $readonlys['umount[/]'] = $readonlys['umount[/apps]'] = true; // do not allow to unmount / or /apps $readonlys['url'] = !self::$is_setup; diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index 26640c907e..3b49a13a1d 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -1107,7 +1107,7 @@ class filemanager_ui if (($readonlys['uid'] = !egw_vfs::$is_root) && !$content['uid']) $content['ro_uid_root'] = 'root'; // only owner can change group & perms if (($readonlys['gid'] = !$content['is_owner'] || - parse_url(egw_vfs::resolve_url($content['path']),PHP_URL_SCHEME) == 'oldvfs')) // no uid, gid or perms in oldvfs + egw_vfs::parse_url(egw_vfs::resolve_url($content['path']),PHP_URL_SCHEME) == 'oldvfs')) // no uid, gid or perms in oldvfs { if (!$content['gid']) $content['ro_gid_root'] = 'root'; foreach($content['perms'] as $name => $value) @@ -1147,7 +1147,7 @@ class filemanager_ui unset($readonlys['tabs']['filemanager.file.eacl']); // --> switch the tab on again foreach($content['eacl'] as &$eacl) { - $eacl['path'] = rtrim(parse_url($eacl['path'],PHP_URL_PATH),'/'); + $eacl['path'] = rtrim(egw_vfs::parse_url($eacl['path'],PHP_URL_PATH),'/'); $readonlys['delete['.$eacl['ino'].'-'.$eacl['owner'].']'] = $eacl['ino'] != $content['ino'] || $eacl['path'] != $content['path'] || !$content['is_owner']; }