Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | install.php_1.patch | 1018 bytes | Jax |
install.php_0.patch | 1018 bytes | plumbley | |
Comments
Comment #1
Jax CreditAttribution: 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 CreditAttribution: 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) CreditAttribution: commented