DataObjects/Images.php
authorleon <leon@roojs.com>
Mon, 18 Dec 2023 04:06:51 +0000 (12:06 +0800)
committerleon <leon@roojs.com>
Mon, 18 Dec 2023 04:06:51 +0000 (12:06 +0800)
DataObjects/Images.php

index c58191b..b3aa1f6 100644 (file)
@@ -202,20 +202,16 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
      */
     function getStoreName() 
     {
-        $opts = HTML_FlexyFramework::get()->Pman;
-        $fn = preg_replace('/[^a-z0-9\.]+/i', '_', $this->filename);
-        return implode( '/', array(
-            $opts['storedir'], '_images_', date('Y/m', strtotime($this->created)), $this->id . '-'. $fn
-        ));
+        return self::staticGetStoreName($this->filename, $this->created, $this->id);
           
     }
 
     static function staticGetStoreName($filename, $created, $id)
     {
         $opts = HTML_FlexyFramework::get()->Pman;
-        $fn = preg_replace('/[^a-z0-9\.]+/i', '_', $this->filename);
+        $fn = preg_replace('/[^a-z0-9\.]+/i', '_', $filename);
         return implode( '/', array(
-            $opts['storedir'], '_images_', date('Y/m', strtotime($this->created)), $this->id . '-'. $fn
+            $opts['storedir'], '_images_', date('Y/m', strtotime($created)), $id . '-'. $fn
         ));
     }