r80706 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80705‎ | r80706 | r80707 >
Date:19:42, 21 January 2011
Author:reedy
Status:ok
Tags:
Comment:
Add missing {}
Modified paths:
  • /trunk/extensions/ConditionalShowSection/ConditionalShowSection.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConditionalShowSection/ConditionalShowSection.php
@@ -72,24 +72,30 @@
7373
7474 # Extract the parameters passed
7575 # the parser lowers the case of all the parameters passed...
76 - if ( isset( $argv["logged"] ) )
77 - {
 76+ if ( isset( $argv["logged"] ) ) {
7877 $userReqLogged = $argv["logged"];
7978
80 - if ( $userReqLogged === "1" && ( $wgUser->isLoggedIn() === true ) )
 79+ if ( $userReqLogged === "1" && ( $wgUser->isLoggedIn() === true ) ) {
8180 $cond1 = true;
 81+ }
8282
83 - if ( $userReqLogged === "0" && ( $wgUser->isLoggedIn() === false ) )
 83+ if ( $userReqLogged === "0" && ( $wgUser->isLoggedIn() === false ) ) {
8484 $cond1 = true;
85 - } else $cond1 = true;
86 - if ( isset( $argv["ingroup"] ) )
87 - {
 85+ }
 86+ } else {
 87+ $cond1 = true;
 88+ }
 89+
 90+ if ( isset( $argv["ingroup"] ) ) {
8891 $userReqGroup = explode( ',', $argv["ingroup"] );
8992 # which groups is the user part of?
9093 $ugroups = $wgUser->getEffectiveGroups(); // changed in v1.4
91 - if ( array_intersect( $userReqGroup, $ugroups ) )
 94+ if ( array_intersect( $userReqGroup, $ugroups ) ) {
9295 $cond2 = true;
93 - } else $cond1 = true;
 96+ }
 97+ } else {
 98+ $cond1 = true;
 99+ }
94100 # if both conditions are met, then SHOW else HIDE
95101 if ( ( $cond1 === true ) and ( $cond2 === true ) ) {
96102 $output = $parser->recursiveTagParse( $input );

Status & tagging log