From b899847009e0bc0dc8e35cec6bba8cd72eb1bb23 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 31 Jan 2011 13:22:36 +0300 Subject: [PATCH] implement a proper fix of cached images URL (refs #305, closes #300) --- functions.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/functions.php b/functions.php index 83cdca3f..0a755936 100644 --- a/functions.php +++ b/functions.php @@ -653,13 +653,11 @@ 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']) { @@ -3714,8 +3712,9 @@ 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") {