--- media.php.orig	2011-04-12 16:52:18.651885892 +0400
+++ media.php	2011-04-13 20:27:02.354342346 +0400
@@ -264,7 +264,8 @@
     $regex = join('|',$types);
 
     // because a temp file was created already
-    if(preg_match('/\.('.$regex.')$/i',$fn)){
+    if(($conf["extensionlessok"] && preg_match('/^[^.]/', $fn)) or
+        preg_match('/\.('.$regex.')$/i',$fn)){
         //check for overwrite
         $overwrite = @file_exists($fn);
         if($overwrite && (!$_REQUEST['ow'] || $auth < AUTH_DELETE)){

