bootstrap.inc produces [Notice] in error_log
AjK - April 26, 2006 - 09:46
| Project: | Drupal |
| Version: | x.y.z |
| Component: | base system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Every drupal page reports :-
PHP Notice: Undefined index: path in /home/drupal/drupal/includes/bootstrap.inc on line 161
Fixed with this:-
--- bootstrap.inc.orig Fri Apr 21 07:39:00 2006
+++ bootstrap.inc Wed Apr 26 10:35:35 2006
@@ -158,7 +158,7 @@ function conf_init() {
$parts = parse_url($base_url);
$base_path = isset($parts['path']) ? $parts['path'] . '/' : '/';
// Build $base_root (everything until first slash after "scheme://").
- $base_root = substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
+ $base_root = substr($base_url, 0, strlen($base_url) - strlen($base_path));
}
else {
// Create base URL
--AjK

#1
#2
The above patch for removing this PHP warning was incorrect.
Here is the code method:-
--- bootstrap.inc.orig Mon May 1 14:22:21 2006+++ bootstrap.inc Mon May 1 14:23:27 2006
@@ -158,7 +158,7 @@ function conf_init() {
$parts = parse_url($base_url);
$base_path = isset($parts['path']) ? $parts['path'] . '/' : '/';
// Build $base_root (everything until first slash after "scheme://").
- $base_root = substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
+ $base_root = @substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
}
else {
// Create base URL
--AjK
#3
Here's a patch to fix the cause of the error rather than suppressing the error.
I think this is rather important to fix, as it happens before our error handler is installed, so the error may be echoed to the browser in certain configurations.
#4
I decided that an if statemkent was better than a ternanry operaor in this case.
Comitted to HEAD.
#5