Hi,
Ugh.
Unbelievable!
I was helping someone with the software on their site today and found that unknown static URIs where not displaying the 404 page as expected.
It turns out that this has indeed been a bug since version 4.0.0.
I don't understand!
I was so sure I'd tested this aspect and no-one else has mentioned this problem.
So apologies to RebelIT, my memory is wrong and somehow this bug has been sitting there all this time. Stunning! Nice co-incidental timing that we both run into this on the same day though!
4.0.7 will be released very soon but in the meantime, this bug can be fixed by doing the following:
Edit includes/classes/class.CeonURIMappingHandler.php
After line 110, insert a "return;" statement. I.e. Change:
PHP Code:
if ($match_uri_result->EOF) {
// URI not found, should the index page be shown or the 404 page?
if (MISSING_PAGE_CHECK == 'On' || MISSING_PAGE_CHECK == 'true') {
$_GET['main_page'] = 'index';
} elseif (MISSING_PAGE_CHECK == 'Page Not Found') {
header('HTTP/1.1 404 Not Found');
$_GET['main_page'] = 'page_not_found';
}
}
to:
PHP Code:
if ($match_uri_result->EOF) {
// URI not found, should the index page be shown or the 404 page?
if (MISSING_PAGE_CHECK == 'On' || MISSING_PAGE_CHECK == 'true') {
$_GET['main_page'] = 'index';
} elseif (MISSING_PAGE_CHECK == 'Page Not Found') {
header('HTTP/1.1 404 Not Found');
$_GET['main_page'] = 'page_not_found';
}
return;
}
As I said, I have no idea how a bug like this could have slipped through the net.
My comment on the next line even says "// Have matched the URI!".. how much clearer to myself could I have been when coding this!?!
Sorry about the trouble.
Hopefully 4.0.7 will be the final version, with no bugs remaining to be found.
At least upgrading is incredibly simple.. :)
All the best..
Conor
ceon
Bookmarks