Kghbln has submitted this change and it was merged.

Change subject: Make 121 release
......................................................................


Make 121 release

* Move the extension's action into a separate file
* Numerous translation updates via translatewiki.net

Change-Id: I93b0eabe1f94f4519a0d1fe2604eeedd76ade452
---
M CHANGELOG
A MinimumNameLength.class.php
M MinimumNameLength.php
3 files changed, 42 insertions(+), 23 deletions(-)

Approvals:
  Kghbln: Verified; Looks good to me, approved



diff --git a/CHANGELOG b/CHANGELOG
index 3885cde..e571969 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,9 +3,11 @@
 
 == Version 1.2.1 ==
 
-THIS IS NOT A RELEASE YET.
+Released on March 10, 2016.
 
 * Migrated wfMsg* to wfMessage
+* Move the extension's action into a separate file
+* Numerous translation updates via translatewiki.net
 
 
 == Version 1.2.0 ==
diff --git a/MinimumNameLength.class.php b/MinimumNameLength.class.php
new file mode 100644
index 0000000..79ac610
--- /dev/null
+++ b/MinimumNameLength.class.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * MinimumNameLength
+ *
+ * @file
+ * @ingroup Extensions
+ *
+ * @license http://www.opensource.org/licenses/BSD-2-Clause BSD 2-clause
+ *
+ */
+
+/**
+ * Hooks account creation and checks the username length, cancelling with an 
error
+ * if the username is too short
+ *
+ * @param User $user User object being created
+ * @param string $error Reference to error message to show
+ * @return bool
+ */
+
+class MinimumNameLength {
+
+       public function onAbortNewAccount( $user, &$error ) {
+               global $wgMinimumUsernameLength;
+
+               if( mb_strlen( $user->getName() ) < $wgMinimumUsernameLength ) {
+
+                       $error = wfMessage( 'minimumnamelength-error' 
)->numParams( $wgMinimumUsernameLength )->plain();
+                       return false;
+               }
+
+               return true;
+       }
+}
diff --git a/MinimumNameLength.php b/MinimumNameLength.php
index 1de493a..06c5d58 100644
--- a/MinimumNameLength.php
+++ b/MinimumNameLength.php
@@ -26,7 +26,7 @@
 $wgExtensionCredits['other'][] = array(
        'path' => '__FILE__',
        'name' => 'Minimum Username Length',
-       'version' => '1.2.1-alpha',
+       'version' => '1.2.1',
        'author' => array(
                'Rob Church',
                'Karsten Hoffmeyer',
@@ -40,29 +40,12 @@
 // Minimum username length to enforce
 $wgMinimumUsernameLength = 10;
 
+// Load exension's class
+$wgAutoloadClasses['MinimumNameLength'] = __DIR__ . 
'/MinimumNameLength.class.php';
+
 // Register extension messages
 $wgMessagesDirs['MinimumNameLength'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['MinimumNameLength'] = __DIR__ . 
'/MinimumNameLength.i18n.php';
 
 // Register hooks
-$wgHooks['AbortNewAccount'][] = 'efMinimumNameLength';
-
-/**
- * Hooks account creation and checks the username length, cancelling with an 
error
- * if the username is too short
- *
- * @param User $user User object being created
- * @param string $error Reference to error message to show
- * @return bool
- */
-function efMinimumNameLength( $user, &$error ) {
-       global $wgMinimumUsernameLength;
-
-       if( mb_strlen( $user->getName() ) < $wgMinimumUsernameLength ) {
-
-               $error = wfMessage( 'minimumnamelength-error' )->numParams( 
$wgMinimumUsernameLength )->plain();
-               return false;
-       }
-
-       return true;
-}
+$wgHooks['AbortNewAccount'][] = 'MinimumNameLength::onAbortNewAccount';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I93b0eabe1f94f4519a0d1fe2604eeedd76ade452
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MinimumNameLength
Gerrit-Branch: master
Gerrit-Owner: Kghbln <kars...@hoffmeyer.info>
Gerrit-Reviewer: Kghbln <kars...@hoffmeyer.info>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to