From aa77e6edf1be4e6fec3af0cd0d5e598fe2e03325 Mon Sep 17 00:00:00 2001 From: real_nowhereman Date: Sat, 29 Mar 2008 11:15:42 +0000 Subject: [PATCH] the infamous "session bug" with antispam should be in fact a bug with prettyurls; some themes might refer their images (or, generally speaking, their resources) via relative paths, which are translated into wrong urls when prettyurls are enabled; this led to secondary requests to the same comment page, which made the plugin regenerate the question! the bug looked random because when those request came BEFORE the main page had been rendered the question stored in session would have been still correct; otherwise, if those came AFTER, the correct question was overwritten, and therefore the result would have been reported as wrong even though at a first glance it was not; now prettyurls correctly 404s when you point to a resource with a wrong path: update your themes if they are suffering from this bug (hey, really, you did not wondered why some images were not displayed sometimes??) :) --- fp-plugins/prettyurls/plugin.prettyurls.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fp-plugins/prettyurls/plugin.prettyurls.php b/fp-plugins/prettyurls/plugin.prettyurls.php index 301f94d..4000f10 100644 --- a/fp-plugins/prettyurls/plugin.prettyurls.php +++ b/fp-plugins/prettyurls/plugin.prettyurls.php @@ -298,7 +298,7 @@ class Plugin_PrettyURLs { // static page $url = preg_replace_callback('|^/([a-zA-Z0-9_-]+)/$|', array(&$this, 'handle_static'), $url); if ($this->status == 2) - return; + return $this->check_url($url); } @@ -307,7 +307,7 @@ class Plugin_PrettyURLs { $url = preg_replace_callback('|page/([0-9]+)/$|', array(&$this, 'handle_page'), $url); if ($this->status == 2) - return; + return $this->check_url($url); if ($this->date_handled){ $url = preg_replace_callback('|^/([^/]+)|', array(&$this, 'handle_entry'), $url); @@ -322,10 +322,14 @@ class Plugin_PrettyURLs { $url = preg_replace_callback('|^/feed(/([^/]*))?|', array(&$this, 'handle_feed'), $url); - + $this->check_url($url); } + function check_url($url) { + if ($url != '/') + $this->fp_params = array('entry'=>'entry000000-000000'); + } function cache_delete_elem($id, $date) { @@ -555,4 +559,4 @@ STR; } -?> +?> \ No newline at end of file