]> git.wh0rd.org Git - tt-rss.git/commitdiff
implement a proper fix of cached images URL (refs #305, closes #300)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 31 Jan 2011 10:22:36 +0000 (13:22 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 31 Jan 2011 10:22:36 +0000 (13:22 +0300)
functions.php

index 83cdca3f71385d1bffe912aabc7e3135063dec97..0a7559368033ba656235fbf67203d351e176601b 100644 (file)
        
                                if (SIMPLEPIE_CACHE_IMAGES && $cache_images) {
 
-                                       $image_handler = get_self_url_prefix() . '/image.php';
-
                                        if (defined('DAEMON_EXTENDED_DEBUG') || $_REQUEST['xdebug']) {
-                                               _debug("enabling image cache: $image_handler");
+                                               _debug("enabling image cache");
                                        }
 
-                                       $rss->set_image_handler($image_handler, 'i');
+                                       $rss->set_image_handler("image.php", 'i');
                                }
        
                                if (defined('DAEMON_EXTENDED_DEBUG') || $_REQUEST['xdebug']) {
                                                rewrite_relative_url($site_url, $entry->getAttribute('href')));
                
                                if ($entry->hasAttribute('src'))
-                                       $entry->setAttribute('src',
-                                               rewrite_relative_url($site_url, $entry->getAttribute('src')));
+                                       if (preg_match('/^image.php\?i=[a-z0-9]+$/', $entry->getAttribute('src')) == 0) 
+                                               $entry->setAttribute('src',
+                                                       rewrite_relative_url($site_url, $entry->getAttribute('src')));
                        }
 
                        if (strtolower($entry->nodeName) == "a") {