(bug 45069) wfParseUrl() no longer produces a PHP notice if passed a "mailto:" URL...
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 18 Feb 2013 12:17:23 +0000 (13:17 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 18 Feb 2013 12:17:23 +0000 (13:17 +0100)
commita7c103ad009eb6ab172fc8099ecbf9a1b8be5e5b
treef19b356e6e17d21c2622a92cd25d29ce741005fc
parentfba656f9861bab41f0d94735bbc5cde672575fd8
(bug 45069) wfParseUrl() no longer produces a PHP notice if passed a "mailto:" URL without address

Calling wfParseUrl( 'mailto:' ) or wfParseUrl( 'mailto:?subject=...' ) was resulting in the following PHP errors:
PHP Notice:  Undefined index: path in includes/GlobalFunctions.php on line 813
PHP Notice:  Undefined index: path in includes/GlobalFunctions.php on line 814

Now the existence of that key is checked and if missing an empty string is set so for consistency of the returned value.

The fix is based on the snippet provided on
https://www.mediawiki.org/wiki/Thread:Project:Support_desk/GLobafunctions.php_wfParseUrl_choking_on_url

Change-Id: Ife07d6e2a364a7cafda387cf7ed9cd71c2b68ef8
RELEASE-NOTES-1.21
includes/GlobalFunctions.php