Index: trunk/phase3/includes/SpecialBlockip.php |
— | — | @@ -19,9 +19,9 @@ |
20 | 20 | $ipb = new IPBlockForm(); |
21 | 21 | |
22 | 22 | $action = $wgRequest->getVal( 'action' ); |
23 | | - if ( "success" == $action ) { $ipb->showSuccess(); } |
24 | | - else if ( $wgRequest->wasPosted() && "submit" == $action ) { $ipb->doSubmit(); } |
25 | | - else { $ipb->showForm( "" ); } |
| 23 | + if ( 'success' == $action ) { $ipb->showSuccess(); } |
| 24 | + else if ( $wgRequest->wasPosted() && 'submit' == $action ) { $ipb->doSubmit(); } |
| 25 | + else { $ipb->showForm( '' ); } |
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
— | — | @@ -40,27 +40,26 @@ |
41 | 41 | $this->BlockExpiry = $wgRequest->getVal( 'wpBlockExpiry' ); |
42 | 42 | } |
43 | 43 | |
44 | | - function showForm( $err ) |
45 | | - { |
| 44 | + function showForm( $err ) { |
46 | 45 | global $wgOut, $wgUser, $wgLang, $wgDefaultBlockExpiry; |
47 | 46 | global $wgRequest; |
48 | 47 | |
49 | | - $wgOut->setPagetitle( htmlspecialchars( wfMsg( "blockip" ) ) ); |
50 | | - $wgOut->addWikiText( htmlspecialchars( wfMsg( "blockiptext" ) ) ); |
| 48 | + $wgOut->setPagetitle( htmlspecialchars( wfMsg( 'blockip' ) ) ); |
| 49 | + $wgOut->addWikiText( htmlspecialchars( wfMsg( 'blockiptext' ) ) ); |
51 | 50 | |
52 | | - if ( is_null( $this->BlockExpiry ) || $this->BlockExpiry === "" ) { |
| 51 | + if ( is_null( $this->BlockExpiry ) || $this->BlockExpiry === '' ) { |
53 | 52 | $this->BlockExpiry = $wgDefaultBlockExpiry; |
54 | 53 | } |
55 | 54 | |
56 | | - $mIpaddress = htmlspecialchars( wfMsg( "ipaddress" ) ); |
57 | | - $mIpbexpiry = htmlspecialchars( wfMsg( "ipbexpiry" ) ); |
58 | | - $mIpbreason = htmlspecialchars( wfMsg( "ipbreason" ) ); |
59 | | - $mIpbsubmit = htmlspecialchars( wfMsg( "ipbsubmit" ) ); |
60 | | - $titleObj = Title::makeTitle( NS_SPECIAL, "Blockip" ); |
| 55 | + $mIpaddress = htmlspecialchars( wfMsg( 'ipaddress' ) ); |
| 56 | + $mIpbexpiry = htmlspecialchars( wfMsg( 'ipbexpiry' ) ); |
| 57 | + $mIpbreason = htmlspecialchars( wfMsg( 'ipbreason' ) ); |
| 58 | + $mIpbsubmit = htmlspecialchars( wfMsg( 'ipbsubmit' ) ); |
| 59 | + $titleObj = Title::makeTitle( NS_SPECIAL, 'Blockip' ); |
61 | 60 | $action = $titleObj->escapeLocalURL( "action=submit" ); |
62 | 61 | |
63 | 62 | if ( "" != $err ) { |
64 | | - $wgOut->setSubtitle( htmlspecialchars( wfMsg( "formerror" ) ) ); |
| 63 | + $wgOut->setSubtitle( htmlspecialchars( wfMsg( 'formerror' ) ) ); |
65 | 64 | $wgOut->addHTML( "<p class='error'>{$err}</p>\n" ); |
66 | 65 | } |
67 | 66 | |
— | — | @@ -113,13 +112,13 @@ |
114 | 113 | if ( preg_match( "/^($rxIP)\\/(\\d{1,2})$/", $this->BlockAddress, $matches ) ) { |
115 | 114 | if ( $wgSysopRangeBans ) { |
116 | 115 | if ( $matches[2] > 31 || $matches[2] < 16 ) { |
117 | | - $this->showForm( wfMsg( "ip_range_invalid" ) ); |
| 116 | + $this->showForm( wfMsg( 'ip_range_invalid' ) ); |
118 | 117 | return; |
119 | 118 | } |
120 | 119 | $this->BlockAddress = Block::normaliseRange( $this->BlockAddress ); |
121 | 120 | } else { |
122 | 121 | # Range block illegal |
123 | | - $this->showForm( wfMsg( "range_block_disabled" ) ); |
| 122 | + $this->showForm( wfMsg( 'range_block_disabled' ) ); |
124 | 123 | return; |
125 | 124 | } |
126 | 125 | } else { |
— | — | @@ -127,34 +126,33 @@ |
128 | 127 | if ( $wgSysopUserBans ) { |
129 | 128 | $userId = User::idFromName( $this->BlockAddress ); |
130 | 129 | if ( $userId == 0 ) { |
131 | | - $this->showForm( wfMsg( "nosuchuser", htmlspecialchars( $this->BlockAddress ) ) ); |
| 130 | + $this->showForm( wfMsg( 'nosuchuser', htmlspecialchars( $this->BlockAddress ) ) ); |
132 | 131 | return; |
133 | 132 | } |
134 | 133 | } else { |
135 | | - $this->showForm( wfMsg( "badipaddress" ) ); |
| 134 | + $this->showForm( wfMsg( 'badipaddress' ) ); |
136 | 135 | return; |
137 | 136 | } |
138 | 137 | } |
139 | 138 | } |
140 | 139 | |
141 | | - if ( $this->BlockExpiry == "infinite" || $this->BlockExpiry == "indefinite" ) { |
| 140 | + if ( $this->BlockExpiry == 'infinite' || $this->BlockExpiry == 'indefinite' ) { |
142 | 141 | $expiry = ''; |
143 | 142 | } else { |
144 | 143 | # Convert GNU-style date, returns -1 on error |
145 | 144 | $expiry = strtotime( $this->BlockExpiry ); |
146 | 145 | |
147 | 146 | if ( $expiry < 0 ) { |
148 | | - $this->showForm( wfMsg( "ipb_expiry_invalid" ) ); |
| 147 | + $this->showForm( wfMsg( 'ipb_expiry_invalid' ) ); |
149 | 148 | return; |
150 | 149 | } |
151 | 150 | |
152 | 151 | $expiry = wfUnix2Timestamp( $expiry ); |
153 | 152 | |
154 | 153 | } |
155 | | - |
156 | 154 | |
157 | | - if ( "" == $this->BlockReason ) { |
158 | | - $this->showForm( wfMsg( "noblockreason" ) ); |
| 155 | + if ( $this->BlockReason == '') { |
| 156 | + $this->showForm( wfMsg( 'noblockreason' ) ); |
159 | 157 | return; |
160 | 158 | } |
161 | 159 | |
— | — | @@ -170,16 +168,16 @@ |
171 | 169 | $log->addEntry( 'block', Title::makeTitle( NS_USER, $this->BlockAddress ), $this->BlockReason ); |
172 | 170 | |
173 | 171 | # Report to the user |
174 | | - $titleObj = Title::makeTitle( NS_SPECIAL, "Blockip" ); |
175 | | - $wgOut->redirect( $titleObj->getFullURL( "action=success&ip={$this->BlockAddress}" ) ); |
| 172 | + $titleObj = Title::makeTitle( NS_SPECIAL, 'Blockip' ); |
| 173 | + $wgOut->redirect( $titleObj->getFullURL( 'action=success&ip='.$this->BlockAddress ) ); |
176 | 174 | } |
177 | 175 | |
178 | 176 | function showSuccess() { |
179 | 177 | global $wgOut, $wgUser; |
180 | 178 | |
181 | | - $wgOut->setPagetitle( wfMsg( "blockip" ) ); |
182 | | - $wgOut->setSubtitle( wfMsg( "blockipsuccesssub" ) ); |
183 | | - $text = wfMsg( "blockipsuccesstext", $this->BlockAddress ); |
| 179 | + $wgOut->setPagetitle( wfMsg( 'blockip' ) ); |
| 180 | + $wgOut->setSubtitle( wfMsg( 'blockipsuccesssub' ) ); |
| 181 | + $text = wfMsg( 'blockipsuccesstext', $this->BlockAddress ); |
184 | 182 | $wgOut->addWikiText( $text ); |
185 | 183 | } |
186 | 184 | } |