r107124 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107123‎ | r107124 | r107125 >
Date:23:51, 22 December 2011
Author:toniher
Status:ok (Comments)
Tags:
Comment:
caching disabling necessary for all functions for better working
Modified paths:
  • /trunk/extensions/UserFunctions/UserFunctions.php (modified) (history)
  • /trunk/extensions/UserFunctions/UserFunctions_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UserFunctions/UserFunctions_body.php
@@ -28,6 +28,8 @@
2929 */
3030 function ifanonObj( &$parser, $frame, $args ) {
3131 $myuser = $this->getUserObj($parser);
 32+ $parser->disableCache();
 33+
3234 if($myuser->isAnon()){
3335 return isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
3436 } else {
@@ -43,6 +45,8 @@
4446 */
4547 function ifblockedObj( &$parser, $frame, $args ) {
4648 $myuser = $this->getUserObj($parser);
 49+ $parser->disableCache();
 50+
4751 if($myuser->isBlocked()){
4852 return isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
4953 } else {
@@ -58,6 +62,8 @@
5963 */
6064 function ifsysopObj( &$parser, $frame, $args ) {
6165 $myuser = $this->getUserObj($parser);
 66+ $parser->disableCache();
 67+
6268 if($myuser->isAllowed('protect')){
6369 return isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
6470 } else {
@@ -73,6 +79,8 @@
7480 */
7581 function ifingroupObj( &$parser, $frame, $args ) {
7682 $myuser = $this->getUserObj($parser);
 83+ $parser->disableCache();
 84+
7785 $grp = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
7886
7987 if($grp!=='' && in_array($grp,$myuser->getEffectiveGroups())){
Index: trunk/extensions/UserFunctions/UserFunctions.php
@@ -1,7 +1,7 @@
22 <?php
33 /**
44 * UserFunctions extension - Provides a set of dynamic parser functions that trigger on the current user.
5 - * @version 2.0 - 2011/12/13 (Based on ParserFunctions)
 5+ * @version 2.1.1 - 2011/12/23 (Based on ParserFunctions)
66 *
77 * @link http://www.mediawiki.org/wiki/Extension:UserFunctions Documentation
88 *
@@ -35,7 +35,7 @@
3636 $wgExtensionCredits['parserhook'][] = array(
3737 'path' => __FILE__,
3838 'name' => 'UserFunctions',
39 - 'version' => '2.1',
 39+ 'version' => '2.1.1',
4040 'url' => 'https://www.mediawiki.org/wiki/Extension:UserFunctions',
4141 'author' => array( 'Algorithm ', 'Toniher', 'Kghbln', 'Wikinaut', '...' ),
4242 'descriptionmsg' => 'userfunctions-desc',

Comments

#Comment by Nikerabbit (talk | contribs)   13:47, 23 December 2011

It's the cost you have to pay.

Status & tagging log