Any non-exist URL results in a 403 forbidden, instead of the expected 404 not found.
This happens only on PHP4, as on my test machine with PHP5 it works like a breeze.
if (!isset($menu['callbacks'][$path])) {
Apparently this expression doesn't result in TRUE if $path is empty.
So i propose to simply add a check:
if (empty($path) || (!isset($menu['callbacks'][$path])) {
For the record, we use Debian 3.1 Sarge:
- apache 2.0.54
- php 4.3.10
This issue applies to 4.7 as well as 5.x. In HEAD there is a new menu system, so it doesn't apply there.
--
Cheers, Danny van der Weide
Comments
Comment #1
ChrisKennedy commentedThis doesn't happen to me on PHP 4.4, so it might only be 4.3 (and maybe earlier).
It would also be helpful if you could submit this as a true cvs patch, please see http://drupal.org/patch
Comment #2
andrewfn commentedI am getting the same problem on all my sites. (Drupal 5.1 - PHP4)
Comment #3
1st-angel commentedthe same for me.
I think this patch fixes the problem.
Comment #4
preferred name commentedThis patch works for me too. However, the default left sidebar (navigator and other blocks) is not displayed when there is a page not found. This appears to be the case with all of the few themes that I have installed.
I am using firefox v2, php4, and drupal 5.1
Comment #5
drummNot showing the blocks on not found pages is actually expected behaviour.
Comment #6
drummAt this point, $path is always a string, so we can
$path == ''instead of empty(). empty() evaluates to TRUE for some random values like"0".Comment #7
chx commentedtwo equal signs won't do.
0 == ''never forget that. You wanted===I believe.Comment #8
drummCommitted to 5.x.
Comment #9
(not verified) commented