Closed (fixed)
Project:
Drupal core
Version:
4.6.9
Component:
base system
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Aug 2006 at 22:43 UTC
Updated:
5 Jan 2007 at 21:13 UTC
ISSUE
When using TCP port based virtual hosts, the directory names being scanned for settings.php files contain a colon, e.g. "localhost:81". The colon is an annoying character in Unix environments, also it can be escaped. However, it is a real problem for Windows environments where it has a special meaning (separator between drive letter and path) and cannot be escaped.
SOLUTION
Replace the colon by something less problematic. The following patch replaces colon with underscore.
Index: drupal-4.6.9/includes/bootstrap.inc
--- drupal-4.6.9/includes/bootstrap.inc.orig 2005-11-30 11:05:16.000000000 +0100
+++ drupal-4.6.9/includes/bootstrap.inc 2006-08-15 16:21:33.490589154 +0200
@@ -54,6 +54,7 @@
for ($i = count($uri) - 1; $i > 0; $i--) {
for ($j = count($server); $j > 0; $j--) {
$dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));
+ $dir = str_replace(':', '_', $dir);
if (file_exists("$confdir/$dir/settings.php")) {
$conf = "$confdir/$dir";
return $conf;
Comments
Comment #1
magico commentedI'm marking this as a bug, because it is a situation that affects all Windows hosting environment.
Comment #2
Steven commentedHmmm, we already handle port numbers in $server in the lines above:
Can you see if $_SERVER['SCRIPT_FILENAME'] or $_SERVER['PHP_SELF'] contain a colon?
Comment #3
Steven commentedComment #4
magico commentedThose lines exist in conf_path() for 4.7.3 but they are not present in conf_init() for 4.6.9
Probably a backport is needed?
In 4.6.9 the following code exists:
In 4.7.3:
Comment #5
magico commentedNo one needs this because it is so "minor".