* Filemanager: fix since PHP 5.5.18 not longer working non-ascii chars in filenames, eg. German umlauts or accents

This commit is contained in:
Ralf Becker 2014-10-18 12:17:17 +00:00
parent 0a00a710f7
commit 93bc0feb16
4 changed files with 14 additions and 14 deletions

View File

@ -327,7 +327,7 @@ class vfs_widget
{ {
if (substr($path,0,6) == '/apps/') 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 //Assemble the thumbnail parameters

View File

@ -337,7 +337,7 @@ switch($cmd)
$mode = $url; // first param is mode $mode = $url; // first param is mode
$url = array_shift($argv); $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) if (strpos($mode,'+') !== false || strpos($mode,'-') !== false)
{ {
@ -362,7 +362,7 @@ switch($cmd)
{ {
$owner = $url; // first param is owner/group $owner = $url; // first param is owner/group
$url = array_shift($argv); $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') if ($owner == 'root')
{ {
$owner = 0; $owner = 0;
@ -388,7 +388,7 @@ switch($cmd)
$params = array($url,$owner); $params = array($url,$owner);
break; break;
} }
if (($scheme = parse_url($url,PHP_URL_SCHEME))) if (($scheme = egw_vfs::parse_url($url,PHP_URL_SCHEME)))
{ {
load_wrapper($url); load_wrapper($url);
} }
@ -418,7 +418,7 @@ switch($cmd)
{ {
if ($argc) 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"; echo "\n$name:\n";
} }
// separate evtl. query part, to re-add it after the file-name // separate evtl. query part, to re-add it after the file-name
@ -446,7 +446,7 @@ switch($cmd)
{ {
if ($argc) 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); fpassthru($f);
fclose($f); fclose($f);
@ -469,7 +469,7 @@ switch($cmd)
*/ */
function load_wrapper($url) 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())) if (!in_array($scheme,stream_get_wrappers()))
{ {
@ -484,7 +484,7 @@ function load_wrapper($url)
default: default:
if (!isset($GLOBALS['egw']) && !in_array($scheme,array('smb','imap'))) 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 // get eGW's __autoload() function
include_once(EGW_API_INC.'/common_functions.inc.php'); 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) function do_stat($url,$long=false,$numeric=false,$full_path=false,$inode=false)
{ {
//echo "do_stat($url,$long,$numeric,$full_path)\n"; //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) 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) 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)) if (is_dir($to))
{ {
list($to,$query) = explode('?',$to,2); list($to,$query) = explode('?',$to,2);
@ -841,7 +841,7 @@ function do_lntree($from,$to)
function _ln($src, $base, $stat) function _ln($src, $base, $stat)
{ {
//echo "_ln('$src', '$base', ".array2string($stat).")\n"; //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)) if (is_link($src))
{ {

View File

@ -178,7 +178,7 @@ class filemanager_admin extends filemanager_ui
'url' => $url, 'url' => $url,
); );
$readonlys["disable[$path]"] = !$this->versioning || !egw_vfs::$is_root || $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['umount[/]'] = $readonlys['umount[/apps]'] = true; // do not allow to unmount / or /apps
$readonlys['url'] = !self::$is_setup; $readonlys['url'] = !self::$is_setup;

View File

@ -1107,7 +1107,7 @@ class filemanager_ui
if (($readonlys['uid'] = !egw_vfs::$is_root) && !$content['uid']) $content['ro_uid_root'] = 'root'; if (($readonlys['uid'] = !egw_vfs::$is_root) && !$content['uid']) $content['ro_uid_root'] = 'root';
// only owner can change group & perms // only owner can change group & perms
if (($readonlys['gid'] = !$content['is_owner'] || 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'; if (!$content['gid']) $content['ro_gid_root'] = 'root';
foreach($content['perms'] as $name => $value) foreach($content['perms'] as $name => $value)
@ -1147,7 +1147,7 @@ class filemanager_ui
unset($readonlys['tabs']['filemanager.file.eacl']); // --> switch the tab on again unset($readonlys['tabs']['filemanager.file.eacl']); // --> switch the tab on again
foreach($content['eacl'] as &$eacl) 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'] || $readonlys['delete['.$eacl['ino'].'-'.$eacl['owner'].']'] = $eacl['ino'] != $content['ino'] ||
$eacl['path'] != $content['path'] || !$content['is_owner']; $eacl['path'] != $content['path'] || !$content['is_owner'];
} }