On first install (and subsequent check), install.php generates the following notices:
Notice: Undefined index: port in c:\program files\apache group\apache\htdocs\drupalhead\install.php on line 113
Notice: Undefined index: port in c:\program files\apache group\apache\htdocs\drupalhead\install.php on line 135
In each case, either in install_verify_settings() or install_change_settings(), following
$url = parse_url($db_url);
the offending line assumes port is set
$db_port = urldecode($url['port']);
whereas parse_url() will only set those parts it finds. For clarity and E_ALL compliance we can change to
$db_port = isset($url['port']) ? urldecode($url['port']) : NULL;
The attached patch does this for both lines. Mark.
Comments
Comment #1
jax commentedYou should set the variable to the empty string because else if there are other issets they will also evaluate to true. Modified your patch to set it to the empty string.
Unless the committer prefers NULL of course. You can choose. Mine is with empty string, the first with NULL. Both tested, both work. Take your pick!
Comment #2
plumbley commentedYes I agree: since
urldecode($an_underfined_variable)evaluatues to the empty string, for maximum compatibility I think it should be as you suggest. Mark.Comment #3
drummCommitted to HEAD.
Comment #4
(not verified) commented