Images.php
authorAlan Knowles <alan@roojs.com>
Wed, 23 May 2012 02:55:51 +0000 (10:55 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 23 May 2012 02:55:51 +0000 (10:55 +0800)
Images.php

index 289f43e..ead5bcb 100644 (file)
@@ -277,6 +277,8 @@ class Pman_Core_Images extends Pman
         // Images/{ID}/fullname.xxxx
         // Images/Thumb/200/{ID}/fullname.xxxx
         // Images/Download/{ID}/fullname.xxxx
+        
+        $attr_url = $attr[$attr_name];
         $umatch  = false;
         if(!preg_match('#/(Images|Images/Thumb/[a-z0-9]+|Images/Download)/([0-9]+)/(.*)$#', $attr_url, $umatch))  {
             continue;
@@ -326,8 +328,8 @@ class Pman_Core_Images extends Pman
         // finally replace the original TAG with the new version..
         
         $new_tag = str_replace(
-            'src="'. $attr['src'] . '"',
-            'src="'. htmlspecialchars($img->URL($thumbsize, $provider, $baseURL)) . '"',
+            $attr_name. '="'. $attr['src'] . '"',
+            $attr_name .'="'. htmlspecialchars($img->URL($thumbsize, $provider, $baseURL)) . '"',
             $tag
         );