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

CommentFileSizeAuthor
#7 menu_not_fund.patch627 byteschx
menu_inc_notfound.patch370 bytesdvdweide

Comments

ChrisKennedy’s picture

This 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

andrewfn’s picture

I am getting the same problem on all my sites. (Drupal 5.1 - PHP4)

1st-angel’s picture

Status: Needs review » Reviewed & tested by the community

the same for me.
I think this patch fixes the problem.

preferred name’s picture

This 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

drumm’s picture

Not showing the blocks on not found pages is actually expected behaviour.

drumm’s picture

Status: Reviewed & tested by the community » Needs work

At this point, $path is always a string, so we can $path == '' instead of empty(). empty() evaluates to TRUE for some random values like "0".

chx’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new627 bytes

two equal signs won't do. 0 == '' never forget that. You wanted === I believe.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.x.

Anonymous’s picture

Status: Fixed » Closed (fixed)