2010-05-07, 21:00:56
(This post was last modified: 2010-05-07, 21:03:05 by bobythomas.)
404 errors seems to not be catch.
When I look the code, I don't understand how it is supposed to work.
You can see my comments in the code below.
When I look the code, I don't understand how it is supposed to work.
You can see my comments in the code below.
Code:
if (! file_exists($file)) {
if (file_exists($file_404)) {
$file = $file_404;
exec_action('error-404');
}
}
/*******************************
Why is there no "else" here ? it sould avoid notices on $data_index properties if the file doesn't exists
********************************/
$data_index = getXML($file);
[...]
$url = $data_index->url;
[...]
/*******************************
I think there are some problems between 403 and 404 and a test on $url is useless because in the case of 404, the url will be empty
********************************/
# if page is private, send to 404 error page
if ($private == 'Y') {
header('Location: 403');
exit;
}
# if page does not exist, throw 404 error
if ($url == '403') {
header('HTTP/1.0 404 Not Found');
}