Don't use error handler that doesn't exist

This commit is contained in:
Jamie Cameron
2024-11-21 20:37:56 -08:00
parent 4f945b0a4e
commit 80e99b7b25

View File

@ -2806,10 +2806,17 @@ local $eh = $error_handler_recurse ? undef :
$config{"error_handler_".$code} ? $config{"error_handler_".$code} :
$config{'error_handler'} ? $config{'error_handler'} : undef;
print DEBUG "http_error code=$code message=$msg body=$body\n";
if ($eh) {
my $found;
foreach my $root (@preroots, @roots) {
$found++ if (-e $root."/".$eh);
}
$eh = undef if (!$found);
}
if ($eh) {
# Call a CGI program for the error
$page = "/$eh";
$querystring = "code=$_[0]&message=".&urlize($msg).
$querystring = "code=".&urlize($code)."&message=".&urlize($msg).
"&body=".&urlize($body);
$error_handler_recurse++;
$ok_code = $code;