@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $blacklist = array("DCC", "CCTP", "PRIVMSG"); |
99 | 99 | $message = str_replace($blacklist, "(IRC Blacklist)", $message); //Lets stop DCC etc |
100 | 100 | |
101 | - $msg = IrcColourCode::RESET . IrcColourCode::BOLD . "[$whichami]" . IrcColourCode::RESET . ": $message"; |
|
101 | + $msg = IrcColourCode::RESET.IrcColourCode::BOLD."[$whichami]".IrcColourCode::RESET.": $message"; |
|
102 | 102 | |
103 | 103 | try { |
104 | 104 | $database = gGetDb('notifications'); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public static function userApproved(User $user) |
138 | 138 | { |
139 | - self::send("{$user->getUsername()} approved by " . User::getCurrent()->getUsername()); |
|
139 | + self::send("{$user->getUsername()} approved by ".User::getCurrent()->getUsername()); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public static function userPromoted(User $user) |
147 | 147 | { |
148 | - self::send("{$user->getUsername()} promoted to tool admin by " . User::getCurrent()->getUsername()); |
|
148 | + self::send("{$user->getUsername()} promoted to tool admin by ".User::getCurrent()->getUsername()); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public static function userDeclined(User $user, $reason) |
157 | 157 | { |
158 | - self::send("{$user->getUsername()} declined by " . User::getCurrent()->getUsername() . " ($reason)"); |
|
158 | + self::send("{$user->getUsername()} declined by ".User::getCurrent()->getUsername()." ($reason)"); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public static function userDemoted(User $user, $reason) |
167 | 167 | { |
168 | - self::send("{$user->getUsername()} demoted by " . User::getCurrent()->getUsername() . " ($reason)"); |
|
168 | + self::send("{$user->getUsername()} demoted by ".User::getCurrent()->getUsername()." ($reason)"); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public static function userSuspended(User $user, $reason) |
177 | 177 | { |
178 | - self::send("{$user->getUsername()} suspended by " . User::getCurrent()->getUsername() . " ($reason)"); |
|
178 | + self::send("{$user->getUsername()} suspended by ".User::getCurrent()->getUsername()." ($reason)"); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public static function userPrefChange(User $user) |
186 | 186 | { |
187 | - self::send("{$user->getUsername()}'s preferences were changed by " . User::getCurrent()->getUsername()); |
|
187 | + self::send("{$user->getUsername()}'s preferences were changed by ".User::getCurrent()->getUsername()); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public static function userRenamed(User $user, $old) |
196 | 196 | { |
197 | - self::send(User::getCurrent()->getUsername() . " renamed $old to {$user->getUsername()}"); |
|
197 | + self::send(User::getCurrent()->getUsername()." renamed $old to {$user->getUsername()}"); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | #endregion |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | public static function interfaceMessageEdited(InterfaceMessage $message) |
209 | 209 | { |
210 | - self::send("Message {$message->getDescription()} ({$message->getId()}) edited by " . User::getCurrent()->getUsername()); |
|
210 | + self::send("Message {$message->getDescription()} ({$message->getId()}) edited by ".User::getCurrent()->getUsername()); |
|
211 | 211 | } |
212 | 212 | #endregion |
213 | 213 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public static function welcomeTemplateCreated(WelcomeTemplate $template) |
220 | 220 | { |
221 | - self::send("Welcome template {$template->getId()} created by " . User::getCurrent()->getUsername()); |
|
221 | + self::send("Welcome template {$template->getId()} created by ".User::getCurrent()->getUsername()); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | public static function welcomeTemplateDeleted($templateid) |
229 | 229 | { |
230 | - self::send("Welcome template {$templateid} deleted by " . User::getCurrent()->getUsername()); |
|
230 | + self::send("Welcome template {$templateid} deleted by ".User::getCurrent()->getUsername()); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public static function welcomeTemplateEdited(WelcomeTemplate $template) |
238 | 238 | { |
239 | - self::send("Welcome template {$template->getId()} edited by " . User::getCurrent()->getUsername()); |
|
239 | + self::send("Welcome template {$template->getId()} edited by ".User::getCurrent()->getUsername()); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | #endregion |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $duration = "indefinitely"; |
253 | 253 | } |
254 | 254 | else { |
255 | - $duration = "until " . date("F j, Y, g:i a", $ban->getDuration()); |
|
255 | + $duration = "until ".date("F j, Y, g:i a", $ban->getDuration()); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | $username = User::getCurrent()->getUsername(); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | */ |
268 | 268 | public static function unbanned(Ban $ban, $unbanreason) |
269 | 269 | { |
270 | - self::send($ban->getTarget() . " unbanned by " . User::getCurrent()->getUsername() . " (" . $unbanreason . ")"); |
|
270 | + self::send($ban->getTarget()." unbanned by ".User::getCurrent()->getUsername()." (".$unbanreason.")"); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | #endregion |
@@ -283,15 +283,15 @@ discard block |
||
283 | 283 | global $baseurl; |
284 | 284 | |
285 | 285 | self::send( |
286 | - IrcColourCode::DARK_GREY . "[[" |
|
287 | - . IrcColourCode::DARK_GREEN . "acc:" |
|
288 | - . IrcColourCode::ORANGE . $request->getId() |
|
289 | - . IrcColourCode::DARK_GREY . "]]" |
|
290 | - . IrcColourCode::RED . " N " |
|
291 | - . IrcColourCode::DARK_BLUE . $baseurl . "/acc.php?action=zoom&id={$request->getId()} " |
|
292 | - . IrcColourCode::DARK_RED . "* " |
|
293 | - . IrcColourCode::DARK_GREEN . $request->getName() |
|
294 | - . IrcColourCode::DARK_RED . " * " |
|
286 | + IrcColourCode::DARK_GREY."[[" |
|
287 | + . IrcColourCode::DARK_GREEN."acc:" |
|
288 | + . IrcColourCode::ORANGE.$request->getId() |
|
289 | + . IrcColourCode::DARK_GREY."]]" |
|
290 | + . IrcColourCode::RED." N " |
|
291 | + . IrcColourCode::DARK_BLUE.$baseurl."/acc.php?action=zoom&id={$request->getId()} " |
|
292 | + . IrcColourCode::DARK_RED."* " |
|
293 | + . IrcColourCode::DARK_GREEN.$request->getName() |
|
294 | + . IrcColourCode::DARK_RED." * " |
|
295 | 295 | . IrcColourCode::RESET |
296 | 296 | ); |
297 | 297 | } |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | */ |
435 | 435 | public static function emailCreated(EmailTemplate $template) |
436 | 436 | { |
437 | - self::send("Email {$template->getId()} ({$template->getName()}) created by " . User::getCurrent()->getUsername()); |
|
437 | + self::send("Email {$template->getId()} ({$template->getName()}) created by ".User::getCurrent()->getUsername()); |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | /** |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | */ |
444 | 444 | public static function emailEdited(EmailTemplate $template) |
445 | 445 | { |
446 | - self::send("Email {$template->getId()} ({$template->getName()}) edited by " . User::getCurrent()->getUsername()); |
|
446 | + self::send("Email {$template->getId()} ({$template->getName()}) edited by ".User::getCurrent()->getUsername()); |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | #endregion |
@@ -258,6 +258,6 @@ |
||
258 | 258 | |
259 | 259 | public function getObjectDescription() |
260 | 260 | { |
261 | - return 'Ban #' . $this->getId() . " (" . htmlentities($this->target) . ")</a>"; |
|
261 | + return 'Ban #'.$this->getId()." (".htmlentities($this->target).")</a>"; |
|
262 | 262 | } |
263 | 263 | } |
@@ -118,6 +118,6 @@ |
||
118 | 118 | |
119 | 119 | public function getObjectDescription() |
120 | 120 | { |
121 | - return '<a href="acc.php?action=messagemgmt&view=' . $this->getId() . '">' . htmlentities($this->description) . "</a>"; |
|
121 | + return '<a href="acc.php?action=messagemgmt&view='.$this->getId().'">'.htmlentities($this->description)."</a>"; |
|
122 | 122 | } |
123 | 123 | } |
@@ -108,6 +108,6 @@ |
||
108 | 108 | |
109 | 109 | public function getObjectDescription() |
110 | 110 | { |
111 | - return '<a href="acc.php?action=templatemgmt&view=' . $this->getId() . '">' . htmlentities($this->usercode) . "</a>"; |
|
111 | + return '<a href="acc.php?action=templatemgmt&view='.$this->getId().'">'.htmlentities($this->usercode)."</a>"; |
|
112 | 112 | } |
113 | 113 | } |
@@ -155,7 +155,7 @@ |
||
155 | 155 | $object = $type::getById($this->objectid, $this->dbObject); |
156 | 156 | |
157 | 157 | if ($object === false) { |
158 | - return '[' . $this->objecttype . " " . $this->objectid . ']'; |
|
158 | + return '['.$this->objecttype." ".$this->objectid.']'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return $object->getObjectDescription(); |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | |
119 | 119 | // not equal to one, as zero uses the plural form too. |
120 | 120 | if ($resultSetCount != 1) { |
121 | - $onlinemessage = $resultSetCount . " Account Creators currently online (past 5 minutes): $creators"; |
|
121 | + $onlinemessage = $resultSetCount." Account Creators currently online (past 5 minutes): $creators"; |
|
122 | 122 | } |
123 | 123 | else { |
124 | - $onlinemessage = $resultSetCount . " Account Creator currently online (past 5 minutes): $creators"; |
|
124 | + $onlinemessage = $resultSetCount." Account Creator currently online (past 5 minutes): $creators"; |
|
125 | 125 | } |
126 | 126 | |
127 | - $online = '<p class="span6 text-right"><small>' . $onlinemessage . '</small></p>'; |
|
127 | + $online = '<p class="span6 text-right"><small>'.$onlinemessage.'</small></p>'; |
|
128 | 128 | |
129 | 129 | if (isset($_SESSION['user'])) { |
130 | 130 | $smarty->assign("onlineusers", $online); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $returnData = $smarty->fetch("alert.tpl"); |
172 | 172 | |
173 | 173 | if ($centre) { |
174 | - $returnData = '<div class="row-fluid"><div class="span8 offset2">' . $returnData . '</div></div>'; |
|
174 | + $returnData = '<div class="row-fluid"><div class="span8 offset2">'.$returnData.'</div></div>'; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | if ($return) { |
@@ -102,8 +102,7 @@ |
||
102 | 102 | $creators = implode( |
103 | 103 | ", ", |
104 | 104 | array_map( |
105 | - function($arg) |
|
106 | - { |
|
105 | + function($arg) { |
|
107 | 106 | /** @var User $arg */ |
108 | 107 | return |
109 | 108 | "<a href=\"statistics.php?page=Users&user=" |
@@ -26,10 +26,10 @@ |
||
26 | 26 | $output .= "#{$count}: "; |
27 | 27 | |
28 | 28 | if (isset($line['type']) && $line['type'] != "") { |
29 | - $output .= $line['class'] . $line['type']; |
|
29 | + $output .= $line['class'].$line['type']; |
|
30 | 30 | } |
31 | 31 | |
32 | - $output .= $line['function'] . "(...)"; |
|
32 | + $output .= $line['function']."(...)"; |
|
33 | 33 | $output .= " [{$line['file']}#{$line['line']}\r\n"; |
34 | 34 | |
35 | 35 | $count++; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | // username can't contain #@/<>[]|{} |
64 | - if (preg_match("/[" . preg_quote("#@/<>[]|{}", "/") . "]/", $this->request->getName()) === 1) { |
|
64 | + if (preg_match("/[".preg_quote("#@/<>[]|{}", "/")."]/", $this->request->getName()) === 1) { |
|
65 | 65 | $errorList[ValidationError::NAME_INVALIDCHAR] = new ValidationError(ValidationError::NAME_INVALIDCHAR); |
66 | 66 | } |
67 | 67 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | global $enableTitleblacklist; |
178 | 178 | if ($enableTitleblacklist == 1) { |
179 | - $apiResult = file_get_contents("https://en.wikipedia.org/w/api.php?action=titleblacklist&tbtitle=" . urlencode($this->request->getName()) . "&tbaction=new-account&tbnooverride&format=php"); |
|
179 | + $apiResult = file_get_contents("https://en.wikipedia.org/w/api.php?action=titleblacklist&tbtitle=".urlencode($this->request->getName())."&tbaction=new-account&tbnooverride&format=php"); |
|
180 | 180 | |
181 | 181 | $data = unserialize($apiResult); |
182 | 182 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | { |
193 | 193 | global $mediawikiWebServiceEndpoint; |
194 | 194 | |
195 | - $userexist = file_get_contents($mediawikiWebServiceEndpoint . "?action=query&list=users&ususers=" . urlencode($this->request->getName()) . "&format=php"); |
|
195 | + $userexist = file_get_contents($mediawikiWebServiceEndpoint."?action=query&list=users&ususers=".urlencode($this->request->getName())."&format=php"); |
|
196 | 196 | $ue = unserialize($userexist); |
197 | 197 | if (!isset ($ue['query']['users']['0']['missing']) && isset ($ue['query']['users']['0']['userid'])) { |
198 | 198 | return true; |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | global $mediawikiWebServiceEndpoint; |
207 | 207 | |
208 | 208 | $reqname = str_replace("_", " ", $this->request->getName()); |
209 | - $userexist = file_get_contents($mediawikiWebServiceEndpoint . "?action=query&meta=globaluserinfo&guiuser=" . urlencode($reqname) . "&format=php"); |
|
209 | + $userexist = file_get_contents($mediawikiWebServiceEndpoint."?action=query&meta=globaluserinfo&guiuser=".urlencode($reqname)."&format=php"); |
|
210 | 210 | $ue = unserialize($userexist); |
211 | 211 | if (isset ($ue['query']['globaluserinfo']['id'])) { |
212 | 212 | return true; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | // Get the closing user's Email signature and append it to the Email. |
38 | 38 | if (User::getCurrent()->getEmailSig() != "") { |
39 | 39 | $emailsig = html_entity_decode(User::getCurrent()->getEmailSig(), ENT_QUOTES, "UTF-8"); |
40 | - mail($target, "RE: [ACC #$id] English Wikipedia Account Request", $template->getText() . "\n\n" . $emailsig, $headers); |
|
40 | + mail($target, "RE: [ACC #$id] English Wikipedia Account Request", $template->getText()."\n\n".$emailsig, $headers); |
|
41 | 41 | } |
42 | 42 | else { |
43 | 43 | mail($target, "RE: [ACC #$id] English Wikipedia Account Request", $template->getText(), $headers); |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | } |
107 | 107 | else { |
108 | 108 | // This is the login form, not the request form. We need protection here. |
109 | - $path = 'https://' . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; |
|
110 | - header("Location: " . $path); |
|
109 | + $path = 'https://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; |
|
110 | + header("Location: ".$path); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | function displayPreview($wikicode) |
205 | 205 | { |
206 | - $parseresult = unserialize(file_get_contents('http://en.wikipedia.org/w/api.php?action=parse&format=php&text=' . urlencode($wikicode))); |
|
206 | + $parseresult = unserialize(file_get_contents('http://en.wikipedia.org/w/api.php?action=parse&format=php&text='.urlencode($wikicode))); |
|
207 | 207 | $out = "<br />\n<h3>Preview</h3>\n<div style=\"border: 2px dashed rgb(26, 79, 133);\">\n<div style=\"margin: 20px;\">"; |
208 | 208 | $out .= $parseresult['parse']['text']['*']; |
209 | 209 | $out .= '</div></div>'; |
@@ -293,8 +293,8 @@ discard block |
||
293 | 293 | */ |
294 | 294 | function welcomerbotRenderSig($creator, $sig) |
295 | 295 | { |
296 | - $signature = html_entity_decode($sig) . ' ~~~~~'; |
|
297 | - if (!preg_match("/((\[\[[ ]*(w:)?[ ]*(en:)?)|(\{\{subst:))[ ]*User[ ]*:[ ]*" . $creator . "[ ]*(\]\]|\||\}\}|\/)/i", $signature)) { |
|
296 | + $signature = html_entity_decode($sig).' ~~~~~'; |
|
297 | + if (!preg_match("/((\[\[[ ]*(w:)?[ ]*(en:)?)|(\{\{subst:))[ ]*User[ ]*:[ ]*".$creator."[ ]*(\]\]|\||\}\}|\/)/i", $signature)) { |
|
298 | 298 | $signature = "--[[User:$creator|$creator]] ([[User talk:$creator|talk]]) ~~~~~"; |
299 | 299 | } |
300 | 300 | return $signature; |
@@ -332,25 +332,25 @@ discard block |
||
332 | 332 | $pluralise = false; |
333 | 333 | } |
334 | 334 | elseif ($secs > 10 && $secs < $minuteCut) { |
335 | - $output = round($secs / $second) . " second"; |
|
335 | + $output = round($secs / $second)." second"; |
|
336 | 336 | } |
337 | 337 | elseif ($secs >= $minuteCut && $secs < $hourCut) { |
338 | - $output = round($secs / $minute) . " minute"; |
|
338 | + $output = round($secs / $minute)." minute"; |
|
339 | 339 | } |
340 | 340 | elseif ($secs >= $hourCut && $secs < $dayCut) { |
341 | - $output = round($secs / $hour) . " hour"; |
|
341 | + $output = round($secs / $hour)." hour"; |
|
342 | 342 | } |
343 | 343 | elseif ($secs >= $dayCut && $secs < $weekCut) { |
344 | - $output = round($secs / $day) . " day"; |
|
344 | + $output = round($secs / $day)." day"; |
|
345 | 345 | } |
346 | 346 | elseif ($secs >= $weekCut && $secs < $month) { |
347 | - $output = round($secs / $week) . " week"; |
|
347 | + $output = round($secs / $week)." week"; |
|
348 | 348 | } |
349 | 349 | elseif ($secs >= $month && $secs < $year) { |
350 | - $output = round($secs / $month) . " month"; |
|
350 | + $output = round($secs / $month)." month"; |
|
351 | 351 | } |
352 | 352 | elseif ($secs >= $year && $secs < $year * 10) { |
353 | - $output = round($secs / $year) . " year"; |
|
353 | + $output = round($secs / $year)." year"; |
|
354 | 354 | } |
355 | 355 | else { |
356 | 356 | $output = "a long time ago"; |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | } |
359 | 359 | |
360 | 360 | if ($pluralise) { |
361 | - $output = (substr($output, 0, 2) <> "1 ") ? $output . "s ago" : $output . " ago"; |
|
361 | + $output = (substr($output, 0, 2) <> "1 ") ? $output."s ago" : $output." ago"; |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | return $output; |
@@ -404,9 +404,9 @@ discard block |
||
404 | 404 | { |
405 | 405 | $userList = ""; |
406 | 406 | foreach ($users as $v) { |
407 | - $userList .= "\"" . htmlentities($v) . "\", "; |
|
407 | + $userList .= "\"".htmlentities($v)."\", "; |
|
408 | 408 | } |
409 | - $userList = "[" . rtrim($userList, ", ") . "]"; |
|
409 | + $userList = "[".rtrim($userList, ", ")."]"; |
|
410 | 410 | $tailscript = <<<JS |
411 | 411 | $('.username-typeahead').typeahead({ |
412 | 412 | source: {$userList} |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | /** Initialises the PHP Session */ |
30 | 30 | function initialiseSession() { |
31 | - session_start(); |
|
31 | + session_start(); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | "requests" => $requests, |
161 | 161 | "total" => $totalRequests, |
162 | 162 | "api" => $v['api'], |
163 | - "type" => $type); |
|
163 | + "type" => $type); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | global $smarty; |
@@ -27,7 +27,8 @@ |
||
27 | 27 | $session = new session(); |
28 | 28 | |
29 | 29 | /** Initialises the PHP Session */ |
30 | -function initialiseSession() { |
|
30 | +function initialiseSession() |
|
31 | +{ |
|
31 | 32 | session_start(); |
32 | 33 | } |
33 | 34 |