diff --git a/filemanager/inc/html.inc.php b/filemanager/inc/html.inc.php
index 56e565e13f..b8240b26ab 100755
--- a/filemanager/inc/html.inc.php
+++ b/filemanager/inc/html.inc.php
@@ -367,7 +367,7 @@ function html_link ($href = NULL, $text = NULL, $return = 0, $encode = 1, $linko
$href = SEP . $href;
/* $phpgw->link requires that the extra vars be passed separately */
- $link_parts = explode ("?", $href, 2);
+ $link_parts = explode ("?", $href);
$address = $GLOBALS['phpgw']->link ($link_parts[0], $link_parts[1]);
}
else
diff --git a/filemanager/inc/main.inc.php b/filemanager/inc/main.inc.php
index f134b807f0..d5324559ac 100755
--- a/filemanager/inc/main.inc.php
+++ b/filemanager/inc/main.inc.php
@@ -179,7 +179,16 @@ function string_encode ($string, $return = False)
{
if (preg_match ("/=(.*)(&|$)/U", $string))
{
- $rstring = preg_replace ("/=(.*)(&|$)/Ue", "'=' . rawurlencode (base64_encode ('\\1')) . '\\2'", $string);
+ $rstring = $string;
+
+ preg_match_all ("/=(.*)(&|$)/U", $string, $matches, PREG_SET_ORDER);
+
+ reset ($matches);
+ while (list (,$match_array) = each ($matches))
+ {
+ $var_encoded = rawurlencode (base64_encode ($match_array[1]));
+ $rstring = str_replace ($match_array[0], '=' . $var_encoded . $match_array[2], $rstring);
+ }
}
elseif (ereg ('^'.$GLOBALS['hostname'], $string))
{
diff --git a/filemanager/index.php b/filemanager/index.php
index f906df87f0..dd90b1a3e1 100755
--- a/filemanager/index.php
+++ b/filemanager/index.php
@@ -7,13 +7,13 @@
$phpwh_debug = 0;
@reset ($GLOBALS['HTTP_POST_VARS']);
-while (list ($name,) = each ($GLOBALS['HTTP_POST_VARS']))
+while (list ($name,) = @each ($GLOBALS['HTTP_POST_VARS']))
{
$$name = $GLOBALS['HTTP_POST_VARS'][$name];
}
@reset ($GLOBALS['HTTP_GET_VARS']);
-while (list ($name,) = each ($GLOBALS['HTTP_GET_VARS']))
+while (list ($name,) = @each ($GLOBALS['HTTP_GET_VARS']))
{
$$name = $GLOBALS['HTTP_GET_VARS'][$name];
}
@@ -235,7 +235,13 @@ if (($path == $GLOBALS['homedir'])
)
{
$GLOBALS['phpgw']->vfs->override_acl = 1;
- $GLOBALS['phpgw']->vfs->mkdir (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE)));
+
+ if (!$GLOBALS['phpgw']->vfs->mkdir (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE))))
+ {
+ $p = $phpgw->vfs->path_parts (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE)));
+ echo $GLOBALS['phpgw']->common->error_list (array ('Could not create directory ' . $GLOBALS['homedir'] . ' (' . $p->real_full_path . ')'));
+ }
+
$GLOBALS['phpgw']->vfs->override_acl = 0;
}
elseif (preg_match ('|^'.$GLOBALS['fakebase'].'\/(.*)$|U', $path, $matches))
diff --git a/filemanager/preferences.php b/filemanager/preferences.php
index a596da65f4..a6aaa91339 100644
--- a/filemanager/preferences.php
+++ b/filemanager/preferences.php
@@ -81,7 +81,7 @@
$templates = array (
'pref' => 'pref.tpl',
'pref_colspan' => 'pref_colspan.tpl',
- 'pref_list' => 'pref_list.tpl',
+ 'pref_list' => 'pref_list.tpl'
);
$p->set_file ($templates);
diff --git a/filemanager/test.php b/filemanager/test.php
index 857469ca24..261d7dcca0 100644
--- a/filemanager/test.php
+++ b/filemanager/test.php
@@ -9,7 +9,7 @@ include("../header.inc.php");
/*
General format for output is:
- function - current directory - input[...] - what output should be - what output was
+ sequence number - function - current directory - input[...] - what output should be - what output was
*/
html_break (1);
@@ -28,8 +28,6 @@ $currentapp = $phpgw_info["flags"]["currentapp"];
$sequence_num = 1;
$phpgw->vfs->cd ();
-//$phpgw->common->phpgw_footer ();
-//$phpgw->common->phpgw_exit ();
$io = array ("" => "$homedir", "dir" => "$homedir/dir", "dir/file" => "$homedir/dir/file", "dir/dir2" => "$homedir/dir/dir2", "dir/dir2/file" => "$homedir/dir/dir2/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "$homedir/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?");
while (list ($i, $o) = each ($io))
@@ -80,7 +78,7 @@ while (list ($i, $o) = each ($io))
$sequence_num = 4;
$cd = "";
$phpgw->vfs->cd (array(
- 'string' => $cd,
+ 'string' => $cd
)
);
$relatives = array (RELATIVE_USER);
@@ -101,7 +99,7 @@ $cd = "test2/test4";
$phpgw->vfs->cd (array(
'string' => $cd,
'relative' => False,
- 'relatives' => array (RELATIVE_NONE),
+ 'relatives' => array (RELATIVE_NONE)
)
);
$relatives = array (RELATIVE_NONE);
@@ -121,7 +119,7 @@ $cd = "test3/test5";
$phpgw->vfs->cd (array(
'string' => $cd,
'relative' => False,
- 'relatives' => array (RELATIVE_NONE),
+ 'relatives' => array (RELATIVE_NONE)
)
);
$relatives = array (RELATIVE_USER_APP);
@@ -271,6 +269,8 @@ while (list ($i, $o) = each ($io))
# end of path_parts tests
###
+$phpgw->vfs->cd ();
+
html_break (2);
html_text_bold ("The less output, the better. Please file errors as a " . html_link ("https://sourceforge.net/tracker/?group_id=7305&atid=107305", "bug report", True, False) . ". Be sure to include the system information line at the top, and anything special about your setup. Thanks!");
diff --git a/phpgwapi/inc/class.vfs_sql.inc.php b/phpgwapi/inc/class.vfs_sql.inc.php
index f6b4b4d914..d4b1a796ed 100644
--- a/phpgwapi/inc/class.vfs_sql.inc.php
+++ b/phpgwapi/inc/class.vfs_sql.inc.php
@@ -181,7 +181,7 @@
*/
function get_relative ()
{
- if (isset ($this->relative))
+ if (isset ($this->relative) && $this->relative)
{
return $this->relative;
}
@@ -1051,7 +1051,7 @@
$basedir = ereg_replace ($sep . $sep, $sep, $basedir);
}
- $basedir = ereg_replace ($sep.'$', '', $basedir);
+ $basedir = ereg_replace ($sep . '$', '', $basedir);
return $basedir;
}
@@ -2685,8 +2685,6 @@
*/
function get_ext_mime_type ($data)
{
- static $mimetype = Array();
-
if (!is_array ($data))
{
$data = array ();
@@ -2701,11 +2699,6 @@
$parts=explode('.',strtolower($file));
$ext=$parts[(sizeof($parts)-1)];
- if(isset($mimetype[$ext]))
- {
- return $mimetype[$ext];
- }
-
for($i=0;$i