X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsite%2FMediaWikiPageNameNormalizer.php;h=8a12c4f7ce683e3ceb374edf1c2536e126afe298;hb=54d50ef3921dc9f30dc4d863ddc471dc564998e9;hp=1a079b4295cf0009844b801ce505d5b7825cf6ab;hpb=b86ef89dd17f51841a220e8ef9b3b8b2402e2547;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/site/MediaWikiPageNameNormalizer.php b/includes/site/MediaWikiPageNameNormalizer.php index 1a079b4295..8a12c4f7ce 100644 --- a/includes/site/MediaWikiPageNameNormalizer.php +++ b/includes/site/MediaWikiPageNameNormalizer.php @@ -53,7 +53,8 @@ class MediaWikiPageNameNormalizer { /** * Returns the normalized form of the given page title, using the * normalization rules of the given site. If the given title is a redirect, - * the redirect weill be resolved and the redirect target is returned. + * the redirect will be resolved and the redirect target is returned. + * Only titles of existing pages will be returned. * * @note This actually makes an API request to the remote site, so beware * that this function is slow and depends on an external service. @@ -65,11 +66,12 @@ class MediaWikiPageNameNormalizer { * @param string $pageName * @param string $apiUrl * - * @return string + * @return string|false The normalized form of the title, + * or false to indicate an invalid title, a missing page, + * or some other kind of error. * @throws \MWException */ public function normalizePageName( $pageName, $apiUrl ) { - // Check if we have strings as arguments. if ( !is_string( $pageName ) ) { throw new \MWException( '$pageName must be a string' );