Liangent has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/62601


Change subject: Do not create babel category when a variant title exists.
......................................................................

Do not create babel category when a variant title exists.

This change depends on I28e4db5c.

Change-Id: I189a8e5671a04d6d8cf5e3ec7563d888b70d3f96
---
M BabelAutoCreate.class.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Babel 
refs/changes/01/62601/1

diff --git a/BabelAutoCreate.class.php b/BabelAutoCreate.class.php
index 8395185..7a95de1 100644
--- a/BabelAutoCreate.class.php
+++ b/BabelAutoCreate.class.php
@@ -43,9 +43,11 @@
         * @param $level String: Level that the category is for.
         */
        public static function create( $category, $code, $level = null ) {
+               global $wgContLang;
                wfProfileIn( __METHOD__ );
                $category = strip_tags( $category );
                $title = Title::makeTitleSafe( NS_CATEGORY, $category );
+               $wgContLang->findVariantTitle( $title, true );
                if ( $title === null || $title->exists() ) {
                        wfProfileOut( __METHOD__ );
                        return;

-- 
To view, visit https://gerrit.wikimedia.org/r/62601
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I189a8e5671a04d6d8cf5e3ec7563d888b70d3f96
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Babel
Gerrit-Branch: master
Gerrit-Owner: Liangent <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to