From: Siebrand Mazeland Date: Mon, 28 Sep 2015 12:19:29 +0000 (+0200) Subject: Fix two PHPCS warnings in NaiveForeignTitleFactory.php X-Git-Tag: 1.31.0-rc.0~9718^2 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=b77eaa1a1a62ac0ed76f766fdeda4dc0a39ebcf0;p=lhc%2Fweb%2Fwiklou.git Fix two PHPCS warnings in NaiveForeignTitleFactory.php Change-Id: I61f1e1beab7e6fdd6e817b728a837d4ea57f435f --- 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;