diff --git a/e107_handlers/file_class.php b/e107_handlers/file_class.php index 9fe5a7a35..2a1e5b144 100644 --- a/e107_handlers/file_class.php +++ b/e107_handlers/file_class.php @@ -1003,24 +1003,27 @@ class e_file */ public function getUserDir($user, $create = false, $subDir = null) { - $user = intval($user); $tp = e107::getParser(); $baseDir = e_MEDIA.'plugins/'.e_CURRENT_PLUGIN.'/'; if(!empty($subDir)) { + $subDir = e107::getParser()->filter($subDir,'w'); $baseDir .= rtrim($subDir,'/').'/'; } - $baseDir .= ($user) ? "user_". $tp->leadingZeros($user, 6) : "anon"; + if(is_numeric($user)) + { + $baseDir .= ($user > 0) ? "user_". $tp->leadingZeros($user, 6) : "anon"; + } if($create == true && !is_dir($baseDir)) { mkdir($baseDir, 0755, true); // recursively } - $baseDir .= "/"; + $baseDir = rtrim($baseDir,'/')."/"; return $baseDir; } diff --git a/e107_handlers/media_class.php b/e107_handlers/media_class.php index c408c80d7..cd5e2a4d8 100644 --- a/e107_handlers/media_class.php +++ b/e107_handlers/media_class.php @@ -969,7 +969,7 @@ class e_media } - + function getPath($mime, $path=null) { $mes = e107::getMessage(); @@ -979,7 +979,7 @@ class e_media if(!vartrue($this->mimePaths[$pmime])) { $this->log("Couldn't detect mime-type ($mime)."); - $text = $text = str_replace('[x]',$mime,IMALAN_111); + $text = $text = str_replace('[x]',$mime,IMALAN_111); //FIXME LAN IMALAN_112 is not generic. This method can be called from anywhere, not only e107_admin/image.php. $mes->add($text, E_MESSAGE_ERROR); return FALSE; }