X-Git-Url: https://git.heureux-cyclage.org/index.php?a=blobdiff_plain;ds=sidebyside;f=includes%2FGlobalFunctions.php;h=92cb8d8569eb41d1d597e8e84e421bda88ea5b67;hb=925fe0df015458a330d320c9f1a0014d32ff8866;hp=2090d90cb746eb78c7fe8e756d09901260ba402a;hpb=1dd1f9225431ebbf6a36cb11bb663bc8ce9fa2f5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 2090d90cb7..92cb8d8569 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -843,10 +843,24 @@ function wfUrlProtocolsWithoutProtRel() { * 1) Does not raise warnings on bad URLs (just returns false). * 2) Handles protocols that don't use :// (e.g., mailto: and news:, as well as * protocol-relative URLs) correctly. - * 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2)). + * 3) Adds a "delimiter" element to the array (see (2)). + * 4) Verifies that the protocol is on the $wgUrlProtocols whitelist. + * 5) Rejects some invalid URLs that parse_url doesn't, e.g. the empty string or URLs starting with + * a line feed character. * * @param string $url A URL to parse - * @return string[]|bool Bits of the URL in an associative array, per PHP docs, false on failure + * @return string[]|bool Bits of the URL in an associative array, or false on failure. + * Possible fields: + * - scheme: URI scheme (protocol), e.g. 'http', 'mailto'. Lowercase, always present, but can + * be an empty string for protocol-relative URLs. + * - delimiter: either '://', ':' or '//'. Always present. + * - host: domain name / IP. Always present, but could be an empty string, e.g. for file: URLs. + * - user: user name, e.g. for HTTP Basic auth URLs such as http://user:pass@example.com/ + * Missing when there is no username. + * - pass: password, same as above. + * - path: path including the leading /. Will be missing when empty (e.g. 'http://example.com') + * - query: query string (as a string; see wfCgiToArray() for parsing it), can be missing. + * - fragment: the part after #, can be missing. */ function wfParseUrl( $url ) { global $wgUrlProtocols; // Allow all protocols defined in DefaultSettings/LocalSettings.php @@ -3447,6 +3461,7 @@ function wfGetMessageCacheStorage() { /** * Get the cache object used by the parser cache * + * @deprecated since 1.30, use MediaWikiServices::getParserCache()->getCacheStorage() * @return BagOStuff */ function wfGetParserCacheStorage() {