support for short urls with image domain
[Pman.Core] / DataObjects / Images.php
index 5783a2d..6401243 100644 (file)
@@ -223,7 +223,11 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         }
         return $ret;
     }
-    
+    /**
+     * the getStorename code got changed, and some old files may not end up with the correct name anymore.
+     * this tries to fix it.
+     *
+     */
     function canFix() {
         // look for the image in the folder, with matching id.
         // this is problematic..
@@ -250,6 +254,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
             return true;
         }
         // fixme - flag it as bad
+        touch($fn . '-really-missing');
     }
     
     
@@ -604,8 +609,10 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
             $id = $matches[1];
         } else if (preg_match('#Images/([0-9]+)/#', $url, $matches)) {
             $id = $matches[1];
+        } else if (preg_match('#images[^/]+/([0-9]+)/#', $url, $matches)) {
+            // supports images.xxxxx.com/{number}/name...
+            $id = $matches[1];
         }
-        
         if ($id === false ||  $id < 1) {
             return false;
         }