fix empty dir parameter for makeCorrectDir() when directory-selection is set to 'Dropdown', thx to D2Red for letting me debug on his system
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
function makeCorrectDir($dir) {
|
||||
|
||||
assert('is_string($dir) && strlen($dir) > 0 /* $dir does not look like an actual folder name */');
|
||||
assert('is_string($dir) && strlen($dir) > 0', 'Value "' . $dir .'" does not look like an actual folder name');
|
||||
|
||||
$dir = trim($dir);
|
||||
|
||||
|
||||
@@ -64,7 +64,12 @@ function makePathfield($path, $uid, $gid, $value = '', $dom = false) {
|
||||
$_field = '';
|
||||
foreach ($dirList as $key => $dir) {
|
||||
if (strpos($dir, $path) === 0) {
|
||||
$dir = makeCorrectDir(substr($dir, strlen($path)));
|
||||
$dir = substr($dir, strlen($path));
|
||||
// docroot cut off of current directory == empty -> directory is the docroot
|
||||
if (empty($dir)) {
|
||||
$dir = '/';
|
||||
}
|
||||
$dir = makeCorrectDir($dir);
|
||||
}
|
||||
$_field.= makeoption($dir, $dir, $value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user