From 12ef0a7ecfc79db7c9fefe627eca7f30e03b3c63 Mon Sep 17 00:00:00 2001 From: real_nowhereman Date: Tue, 19 Feb 2008 20:19:05 +0000 Subject: [PATCH] should fix bad handling of 404 by making up a non existent entry -- unless you've written one on 00/00/2000 at 00:00:00, and then you really should tell me on WHICH DAY and MONTH that happened because if I were in you I'd be scared :P --- fp-plugins/prettyurls/plugin.prettyurls.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fp-plugins/prettyurls/plugin.prettyurls.php b/fp-plugins/prettyurls/plugin.prettyurls.php index 4045d39..16583d7 100644 --- a/fp-plugins/prettyurls/plugin.prettyurls.php +++ b/fp-plugins/prettyurls/plugin.prettyurls.php @@ -184,8 +184,13 @@ class Plugin_PrettyURLs { function handle_entry($matches) { if (PRETTYURLS_TITLES) { - if (isset($this->index[$_GET['y']][$_GET['m']][$_GET['d']][md5($matches[1])])) + if (isset($this->index[$_GET['y']][$_GET['m']][$_GET['d']][md5($matches[1])])) { $_GET['entry'] = $this->index[$_GET['y']][$_GET['m']][$_GET['d']][md5($matches[1])]; + } else { + // a bit hackish: we make up a fake url when there is no match, + // so that at the higher level the system will 404... + $_GET['entry'] = 'entry000000-000000'; + } } else { $_GET['entry'] = $matches[1]; }