DataObjects/Images.php
authorEdward <edward@roojs.com>
Wed, 26 Jun 2013 11:29:01 +0000 (19:29 +0800)
committerEdward <edward@roojs.com>
Wed, 26 Jun 2013 11:29:01 +0000 (19:29 +0800)
DataObjects/Images.php

index 7b8fe04..7415567 100644 (file)
@@ -75,9 +75,10 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
             $y = new File_MimeType();
             $ext = $y->toExt(trim((string) $imageInfo['mime'] ));
             
-//            if (!preg_match("/\." . $ext."$/", $path, $matches)) {
-//                rename($path,$path.$ext);
-//            }
+            if (!preg_match("/\." . $ext."$/", $path, $matches)) {
+                rename($path,$path.".".$ext);
+                $path.= ".".$ext;
+            }
             
             if (!$this->createFrom($path)) {
                 $roo->jerr("erro making image" . $q['_remote_upload']);