X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ftitle%2FNaiveForeignTitleFactory.php;h=2c2f94b2a2050c3f584ef26da80306d5ecac1126;hb=3a922d36d8741e34d9ce46cb601e1f356dcf844d;hp=6c8bcc04e8fa912ff3063dda93cf20198854c8d7;hpb=b9e0a89536c0ba9332dbf9aaf015b3aaaf1d41a8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/title/NaiveForeignTitleFactory.php b/includes/title/NaiveForeignTitleFactory.php index 6c8bcc04e8..2c2f94b2a2 100644 --- a/includes/title/NaiveForeignTitleFactory.php +++ b/includes/title/NaiveForeignTitleFactory.php @@ -45,16 +45,18 @@ class NaiveForeignTitleFactory implements ForeignTitleFactory { global $wgContLang; - // Can we assume that the part of the page title before the colon is a - // namespace name? - // - // XML export schema version 0.5 and earlier (MW 1.18 and earlier) does not - // contain a tag, so we need to be able to handle that case. - // - // If we know the namespace ID, we assume a non-zero namespace ID means - // the ':' sets off a valid namespace name. If we don't know the namespace - // ID, we fall back to using the local wiki's namespace names to resolve - // this -- better than nothing, and mimics the old crappy behavior + /** + * Can we assume that the part of the page title before the colon is a + * namespace name? + * + * XML export schema version 0.5 and earlier (MW 1.18 and earlier) does not + * contain a tag, so we need to be able to handle that case. + * + * If we know the namespace ID, we assume a non-zero namespace ID means + * the ':' sets off a valid namespace name. If we don't know the namespace + * ID, we fall back to using the local wiki's namespace names to resolve + * this -- better than nothing, and mimics the old crappy behavior + */ $isNamespacePartValid = is_null( $ns ) ? ( $wgContLang->getNsIndex( $pieces[0] ) !== false ) : $ns != 0;