summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2018-11-20 11:13:56 -0500
committerBrian Evans <grknight@gentoo.org>2018-11-20 11:13:56 -0500
commitb2c84b62632b1be2bd755e1ebc5ea3198a0e3f36 (patch)
tree67f71b6a20aaf9124e83f5b2b8ce5efaf1647315 /UserFunctions/UserFunctions.php
parentReplaceText: Update to REL_1_30 (diff)
downloadextensions-b2c84b62632b1be2bd755e1ebc5ea3198a0e3f36.tar.gz
extensions-b2c84b62632b1be2bd755e1ebc5ea3198a0e3f36.tar.bz2
extensions-b2c84b62632b1be2bd755e1ebc5ea3198a0e3f36.zip
UserFunctions: Update for MW1.30 and upstream version 2.7.0
Signed-off-by: Brian Evans <grknight@gentoo.org>
Diffstat (limited to 'UserFunctions/UserFunctions.php')
-rw-r--r--UserFunctions/UserFunctions.php31
1 files changed, 19 insertions, 12 deletions
diff --git a/UserFunctions/UserFunctions.php b/UserFunctions/UserFunctions.php
index dbf4563a..ea644436 100644
--- a/UserFunctions/UserFunctions.php
+++ b/UserFunctions/UserFunctions.php
@@ -1,9 +1,11 @@
<?php
/**
* UserFunctions extension - Provides a set of dynamic parser functions that trigger on the current user.
- * @version 2.6.0 - 2014/09/18 (Based on ParserFunctions)
+ * @version 2.7.0 - 2017/07/26 (Based on ParserFunctions)
*
- * @link http://www.mediawiki.org/wiki/Extension:UserFunctions Documentation
+ * @link https://www.mediawiki.org/wiki/Extension:UserFunctions Documentation
+ * @link https://www.mediawiki.org/wiki/Extension_talk:UserFunctions Support
+ * @link https://phabricator.wikimedia.org/diffusion/EUFU/ Source code
*
* @file UserFunctions.php
* @ingroup Extensions
@@ -16,9 +18,10 @@
* @author Toniher
* @author Uckelman
* @copyright (C) 2006 Algorithm
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
+ * @license https://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*/
+// Ensure that the script cannot be executed outside of MediaWiki.
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This file is a MediaWiki extension, it is not a valid entry point' );
}
@@ -46,16 +49,20 @@ call_user_func( function() {
$GLOBALS['wgExtensionCredits']['parserhook'][] = array(
'path' => __FILE__,
'name' => 'UserFunctions',
- 'version' => '2.6.0',
+ 'version' => '2.7.0',
'url' => 'https://www.mediawiki.org/wiki/Extension:UserFunctions',
- 'author' => array( 'Algorithm ', 'Toniher', 'Kghbln', 'Wikinaut', 'Reedy', '...' ),
+ 'author' => array(
+ 'Ross McClure',
+ 'Toni Hermoso Pulido',
+ '...'
+ ),
'descriptionmsg' => 'userfunctions-desc',
+ 'license-name' => 'GPL-2.0+'
);
- $GLOBALS['wgAutoloadClasses']['ExtUserFunctions'] = dirname(__FILE__).'/UserFunctions_body.php';
+ $GLOBALS['wgAutoloadClasses']['ExtUserFunctions'] = __DIR__ .'/UserFunctions_body.php';
$GLOBALS['wgMessagesDirs']['UserFunctions'] = __DIR__ . '/i18n';
- $GLOBALS['wgExtensionMessagesFiles']['UserFunctions'] = dirname( __FILE__ ) . '/UserFunctions.i18n.php';
- $GLOBALS['wgExtensionMessagesFiles']['UserFunctionsMagic'] = dirname( __FILE__ ) . '/UserFunctions.i18n.magic.php';
+ $GLOBALS['wgExtensionMessagesFiles']['UserFunctionsMagic'] = __DIR__ . '/UserFunctions.i18n.magic.php';
$GLOBALS['wgHooks']['ParserFirstCallInit'][] = 'wfRegisterUserFunctions';
});
@@ -99,10 +106,10 @@ function wfRegisterUserFunctions( $parser ) {
if ( $process ) {
// These functions accept DOM-style arguments
- $parser->setFunctionHook( 'ifanon', 'ExtUserFunctions::ifanonObj', SFH_OBJECT_ARGS );
- $parser->setFunctionHook( 'ifblocked', 'ExtUserFunctions::ifblockedObj', SFH_OBJECT_ARGS );
- $parser->setFunctionHook( 'ifsysop', 'ExtUserFunctions::ifsysopObj', SFH_OBJECT_ARGS );
- $parser->setFunctionHook( 'ifingroup', 'ExtUserFunctions::ifingroupObj', SFH_OBJECT_ARGS );
+ $parser->setFunctionHook( 'ifanon', 'ExtUserFunctions::ifanonObj', Parser::SFH_OBJECT_ARGS );
+ $parser->setFunctionHook( 'ifblocked', 'ExtUserFunctions::ifblockedObj', Parser::SFH_OBJECT_ARGS );
+ $parser->setFunctionHook( 'ifsysop', 'ExtUserFunctions::ifsysopObj', Parser::SFH_OBJECT_ARGS );
+ $parser->setFunctionHook( 'ifingroup', 'ExtUserFunctions::ifingroupObj', Parser::SFH_OBJECT_ARGS );
if ($wgUFEnablePersonalDataFunctions) {
$parser->setFunctionHook( 'realname', 'ExtUserFunctions::realname' );