DataObjects/core.sql
[Pman.Core] / Images.php
index b1ce951..9554939 100644 (file)
@@ -228,11 +228,11 @@ class Pman_Core_Images extends Pman
         if (!isset($ff->Pman_Images['public_baseURL'])) {
             return $html;
         }
-        var_dump($ff->Pman_Images['public_baseURL']);
+        //var_dump($ff->Pman_Images['public_baseURL']);
         $baseURL = $ff->Pman_Images['public_baseURL'];
         
-        preg_match_all('/<img\w[^>]+>/i',$html, $result); 
-
+        preg_match_all('/<img\s+[^>]+>/i',$html, $result); 
+        //print_r($result);
         $matches = array_unique($result[0]);
         foreach($matches as $img) {
             $imatch = array();
@@ -250,7 +250,7 @@ class Pman_Core_Images extends Pman
         }
         
         $result = array();
-        preg_match_all('/<a\w[^>]+>/i',$html, $result); 
+        preg_match_all('/<a\s+[^>]+>/i',$html, $result); 
 
         $matches = array_unique($result[0]);
         foreach($matches as $img) {
@@ -273,7 +273,7 @@ class Pman_Core_Images extends Pman
     static function replaceImgUrl($html, $baseURL, $tag, $attr, $attr_name) 
     {
         
-        print_R($attr);
+        //print_R($attr);
         // see if it's an image url..
         // Images/{ID}/fullname.xxxx
         // Images/Thumb/200/{ID}/fullname.xxxx
@@ -294,9 +294,9 @@ class Pman_Core_Images extends Pman
          
         if (count($type) > 2 && $type[1] == 'Thumb') {
             $thumbsize = $type[2];
-            $provider = 'Images/Thumb';
+            $provider = '/Images/Thumb';
         } else {
-            $provider = $umatch[1];
+            $provider = '/'.$umatch[1];
         }
         
         if (!empty($attr['width']) || !empty($attr['height']) )
@@ -306,7 +306,7 @@ class Pman_Core_Images extends Pman
                 (empty($attr['width']) ? '0' : $attr['width'] * 1) .
                 'x' .
                 (empty($attr['height']) ? '0' : $attr['height'] * 1);
-            
+             $provider = '/Images/Thumb';
             
         }