First up thanks for a great blog
I've just been playing with s9y for a few days now and all is great apart from the following:
If a user enters an invalid (404) URI, the code in index.php appears to still divert the user to the index page instead of displaying the 404 error message as it presumably is supposed to. From what I can see this is because of the following code from index.php - line 132 onwards:
Code: Select all
} else if (preg_match('@/categories/(.*)@', $uri, $matches) ||
preg_match('@/(index\.(php|html))?@', $uri) ||
preg_match('@/(' . preg_quote($serendipity['indexFile']) . ')?@', $uri)) {
For example this URI:
http://blog.munk.nu/nonexistent
should presumably invoke the 'catchall' code in index.php:
Code: Select all
} else {
printf(DOCUMENT_NOT_FOUND, $uri);
}
From what I can tell this is because of the pcre '?' in the regexps in the first 2 preg_match statements - changing the code to this has the desired effect:
Code: Select all
} else if (preg_match('@/categories/(.*)@', $uri, $matches) ||
preg_match('@/(index\.(php|html))@', $uri) ||
preg_match('@/(' . preg_quote($serendipity['indexFile']) . ')@', $uri)) {
Should the '?' be removed or just be escaped? Or am I totally wrong?
TIA