Passed
Push — rbac ( 82b65f...a43d05 )
by Michael
02:23
created
backup.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  ******************************************************************************/
8 8
 
9 9
 if (isset($_SERVER['REQUEST_METHOD'])) {
10
-    die();
10
+	die();
11 11
 } //Web clients die.
12 12
 
13 13
 // Get all the classes.
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 
20 20
 $arg = $argv['1'];
21 21
 if ($arg == "--monthly") {
22
-    echo "running monthly backups.\n";
23
-    $dateModifier = date("FY");
24
-    $cmdLine = "$BUtar $BUmonthdir/mBackup-$dateModifier.tar $BUdir/*.sql.gz; rm $BUdir/*.sql.gz";
25
-    echo "running command $cmdLine\n";
26
-    shell_exec($cmdLine);
27
-    die("done.");
22
+	echo "running monthly backups.\n";
23
+	$dateModifier = date("FY");
24
+	$cmdLine = "$BUtar $BUmonthdir/mBackup-$dateModifier.tar $BUdir/*.sql.gz; rm $BUdir/*.sql.gz";
25
+	echo "running command $cmdLine\n";
26
+	shell_exec($cmdLine);
27
+	die("done.");
28 28
 }
29 29
 
30 30
 echo "running nightly backups\n";
Please login to merge, or discard this patch.
smarty-plugins/modifier.date.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@
 block discarded – undo
16 16
  */
17 17
 function smarty_modifier_date($input)
18 18
 {
19
-    if (gettype($input) === 'object'
20
-        && (get_class($input) === DateTime::class || get_class($input) === DateTimeImmutable::class)
21
-    ) {
22
-        /** @var $date DateTime|DateTimeImmutable */
23
-        $date = $input;
24
-        $dateString = $date->format('Y-m-d H:i:s');
19
+	if (gettype($input) === 'object'
20
+		&& (get_class($input) === DateTime::class || get_class($input) === DateTimeImmutable::class)
21
+	) {
22
+		/** @var $date DateTime|DateTimeImmutable */
23
+		$date = $input;
24
+		$dateString = $date->format('Y-m-d H:i:s');
25 25
 
26
-        return $dateString;
27
-    }
28
-    else {
29
-        return $input;
30
-    }
26
+		return $dateString;
27
+	}
28
+	else {
29
+		return $input;
30
+	}
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
         $dateString = $date->format('Y-m-d H:i:s');
25 25
 
26 26
         return $dateString;
27
-    }
28
-    else {
27
+    } else {
29 28
         return $input;
30 29
     }
31 30
 }
32 31
\ No newline at end of file
Please login to merge, or discard this patch.
smarty-plugins/modifier.relativedate.php 2 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -16,68 +16,68 @@
 block discarded – undo
16 16
  */
17 17
 function smarty_modifier_relativedate($input)
18 18
 {
19
-    $now = new DateTime();
19
+	$now = new DateTime();
20 20
 
21
-    if (gettype($input) === 'object'
22
-        && (get_class($input) === DateTime::class || get_class($input) === DateTimeImmutable::class)
23
-    ) {
24
-        $then = $input;
25
-    }
26
-    else {
27
-        $then = new DateTime($input);
28
-    }
21
+	if (gettype($input) === 'object'
22
+		&& (get_class($input) === DateTime::class || get_class($input) === DateTimeImmutable::class)
23
+	) {
24
+		$then = $input;
25
+	}
26
+	else {
27
+		$then = new DateTime($input);
28
+	}
29 29
 
30
-    $secs = $now->getTimestamp() - $then->getTimestamp();
30
+	$secs = $now->getTimestamp() - $then->getTimestamp();
31 31
 
32
-    $second = 1;
33
-    $minute = 60 * $second;
34
-    $minuteCut = 60 * $second;
35
-    $hour = 60 * $minute;
36
-    $hourCut = 90 * $minute;
37
-    $day = 24 * $hour;
38
-    $dayCut = 48 * $hour;
39
-    $week = 7 * $day;
40
-    $weekCut = 14 * $day;
41
-    $month = 30 * $day;
42
-    $monthCut = 60 * $day;
43
-    $year = 365 * $day;
44
-    $yearCut = $year * 2;
32
+	$second = 1;
33
+	$minute = 60 * $second;
34
+	$minuteCut = 60 * $second;
35
+	$hour = 60 * $minute;
36
+	$hourCut = 90 * $minute;
37
+	$day = 24 * $hour;
38
+	$dayCut = 48 * $hour;
39
+	$week = 7 * $day;
40
+	$weekCut = 14 * $day;
41
+	$month = 30 * $day;
42
+	$monthCut = 60 * $day;
43
+	$year = 365 * $day;
44
+	$yearCut = $year * 2;
45 45
 
46
-    $pluralise = true;
46
+	$pluralise = true;
47 47
 
48
-    if ($secs <= 10) {
49
-        $output = "just now";
50
-        $pluralise = false;
51
-    }
52
-    elseif ($secs > 10 && $secs < $minuteCut) {
53
-        $output = round($secs / $second) . " second";
54
-    }
55
-    elseif ($secs >= $minuteCut && $secs < $hourCut) {
56
-        $output = round($secs / $minute) . " minute";
57
-    }
58
-    elseif ($secs >= $hourCut && $secs < $dayCut) {
59
-        $output = round($secs / $hour) . " hour";
60
-    }
61
-    elseif ($secs >= $dayCut && $secs < $weekCut) {
62
-        $output = round($secs / $day) . " day";
63
-    }
64
-    elseif ($secs >= $weekCut && $secs < $monthCut) {
65
-        $output = round($secs / $week) . " week";
66
-    }
67
-    elseif ($secs >= $monthCut && $secs < $yearCut) {
68
-        $output = round($secs / $month) . " month";
69
-    }
70
-    elseif ($secs >= $yearCut && $secs < $year * 10) {
71
-        $output = round($secs / $year) . " year";
72
-    }
73
-    else {
74
-        $output = "a long time ago";
75
-        $pluralise = false;
76
-    }
48
+	if ($secs <= 10) {
49
+		$output = "just now";
50
+		$pluralise = false;
51
+	}
52
+	elseif ($secs > 10 && $secs < $minuteCut) {
53
+		$output = round($secs / $second) . " second";
54
+	}
55
+	elseif ($secs >= $minuteCut && $secs < $hourCut) {
56
+		$output = round($secs / $minute) . " minute";
57
+	}
58
+	elseif ($secs >= $hourCut && $secs < $dayCut) {
59
+		$output = round($secs / $hour) . " hour";
60
+	}
61
+	elseif ($secs >= $dayCut && $secs < $weekCut) {
62
+		$output = round($secs / $day) . " day";
63
+	}
64
+	elseif ($secs >= $weekCut && $secs < $monthCut) {
65
+		$output = round($secs / $week) . " week";
66
+	}
67
+	elseif ($secs >= $monthCut && $secs < $yearCut) {
68
+		$output = round($secs / $month) . " month";
69
+	}
70
+	elseif ($secs >= $yearCut && $secs < $year * 10) {
71
+		$output = round($secs / $year) . " year";
72
+	}
73
+	else {
74
+		$output = "a long time ago";
75
+		$pluralise = false;
76
+	}
77 77
 
78
-    if ($pluralise) {
79
-        $output = (substr($output, 0, 2) <> "1 ") ? $output . "s ago" : $output . " ago";
80
-    }
78
+	if ($pluralise) {
79
+		$output = (substr($output, 0, 2) <> "1 ") ? $output . "s ago" : $output . " ago";
80
+	}
81 81
 
82
-    return $output;
82
+	return $output;
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
         && (get_class($input) === DateTime::class || get_class($input) === DateTimeImmutable::class)
23 23
     ) {
24 24
         $then = $input;
25
-    }
26
-    else {
25
+    } else {
27 26
         $then = new DateTime($input);
28 27
     }
29 28
 
@@ -48,29 +47,21 @@  discard block
 block discarded – undo
48 47
     if ($secs <= 10) {
49 48
         $output = "just now";
50 49
         $pluralise = false;
51
-    }
52
-    elseif ($secs > 10 && $secs < $minuteCut) {
50
+    } elseif ($secs > 10 && $secs < $minuteCut) {
53 51
         $output = round($secs / $second) . " second";
54
-    }
55
-    elseif ($secs >= $minuteCut && $secs < $hourCut) {
52
+    } elseif ($secs >= $minuteCut && $secs < $hourCut) {
56 53
         $output = round($secs / $minute) . " minute";
57
-    }
58
-    elseif ($secs >= $hourCut && $secs < $dayCut) {
54
+    } elseif ($secs >= $hourCut && $secs < $dayCut) {
59 55
         $output = round($secs / $hour) . " hour";
60
-    }
61
-    elseif ($secs >= $dayCut && $secs < $weekCut) {
56
+    } elseif ($secs >= $dayCut && $secs < $weekCut) {
62 57
         $output = round($secs / $day) . " day";
63
-    }
64
-    elseif ($secs >= $weekCut && $secs < $monthCut) {
58
+    } elseif ($secs >= $weekCut && $secs < $monthCut) {
65 59
         $output = round($secs / $week) . " week";
66
-    }
67
-    elseif ($secs >= $monthCut && $secs < $yearCut) {
60
+    } elseif ($secs >= $monthCut && $secs < $yearCut) {
68 61
         $output = round($secs / $month) . " month";
69
-    }
70
-    elseif ($secs >= $yearCut && $secs < $year * 10) {
62
+    } elseif ($secs >= $yearCut && $secs < $year * 10) {
71 63
         $output = round($secs / $year) . " year";
72
-    }
73
-    else {
64
+    } else {
74 65
         $output = "a long time ago";
75 66
         $pluralise = false;
76 67
     }
Please login to merge, or discard this patch.
redir.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -7,43 +7,43 @@
 block discarded – undo
7 7
  ******************************************************************************/
8 8
 
9 9
 $toolList = array(
10
-    'tparis-pcount'      => '//tools.wmflabs.org/supercount/index.php?user=%DATA%&project=en.wikipedia',
11
-    'luxo-contributions' => '//tools.wmflabs.org/quentinv57-tools/tools/globalcontribs.php?username=%DATA%',
12
-    'guc'                => '//tools.wmflabs.org/guc/?user=%DATA%',
13
-    'oq-whois'           => 'https://whois.domaintools.com/%DATA%',
10
+	'tparis-pcount'      => '//tools.wmflabs.org/supercount/index.php?user=%DATA%&project=en.wikipedia',
11
+	'luxo-contributions' => '//tools.wmflabs.org/quentinv57-tools/tools/globalcontribs.php?username=%DATA%',
12
+	'guc'                => '//tools.wmflabs.org/guc/?user=%DATA%',
13
+	'oq-whois'           => 'https://whois.domaintools.com/%DATA%',
14 14
 	'tl-whois'           => 'https://tools.wmflabs.org/whois/gateway.py?lookup=true&ip=%DATA%',
15
-    'sulutil'            => '//tools.wmflabs.org/quentinv57-tools/tools/sulinfo.php?showinactivity=1&showblocks=1&username=%DATA%',
16
-    'google'             => 'https://www.google.com/search?q=%DATA%',
17
-    'domain'             => 'http://%DATA%/',
15
+	'sulutil'            => '//tools.wmflabs.org/quentinv57-tools/tools/sulinfo.php?showinactivity=1&showblocks=1&username=%DATA%',
16
+	'google'             => 'https://www.google.com/search?q=%DATA%',
17
+	'domain'             => 'http://%DATA%/',
18 18
 );
19 19
 
20 20
 if (!isset($_GET['tool'])
21
-    || !isset($toolList[$_GET['tool']])
22
-    || !isset($_GET['data'])
21
+	|| !isset($toolList[$_GET['tool']])
22
+	|| !isset($_GET['data'])
23 23
 ) {
24
-    header("HTTP/1.1 403 Forbidden");
24
+	header("HTTP/1.1 403 Forbidden");
25 25
 
26
-    return;
26
+	return;
27 27
 }
28 28
 
29 29
 if (isset($_GET['round2'])) {
30
-    $data = $_GET['data'];
31
-    $tool = $_GET['tool'];
30
+	$data = $_GET['data'];
31
+	$tool = $_GET['tool'];
32 32
 
33
-    if ($tool === 'domain') {
34
-        // quick security check - if you want to exploit something, you better be sure your exploit resolves via dns.
35
-        // this is not intended to catch everything, just as a quick sanity check.
36
-        if (gethostbyname($data) == $data) {
37
-            echo 'Error resolving hostname, it doesn\'t look like this domain exists.';
38
-            die();
39
-        }
40
-    }
41
-    else {
42
-        $data = htmlentities($data, ENT_COMPAT, 'UTF-8');
43
-    }
33
+	if ($tool === 'domain') {
34
+		// quick security check - if you want to exploit something, you better be sure your exploit resolves via dns.
35
+		// this is not intended to catch everything, just as a quick sanity check.
36
+		if (gethostbyname($data) == $data) {
37
+			echo 'Error resolving hostname, it doesn\'t look like this domain exists.';
38
+			die();
39
+		}
40
+	}
41
+	else {
42
+		$data = htmlentities($data, ENT_COMPAT, 'UTF-8');
43
+	}
44 44
 
45
-    echo '<script>window.location.href="' . str_replace("%DATA%", $data, $toolList[$tool]) . '"</script>';
45
+	echo '<script>window.location.href="' . str_replace("%DATA%", $data, $toolList[$tool]) . '"</script>';
46 46
 }
47 47
 else {
48
-    header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true");
48
+	header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true");
49 49
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,13 +37,11 @@
 block discarded – undo
37 37
             echo 'Error resolving hostname, it doesn\'t look like this domain exists.';
38 38
             die();
39 39
         }
40
-    }
41
-    else {
40
+    } else {
42 41
         $data = htmlentities($data, ENT_COMPAT, 'UTF-8');
43 42
     }
44 43
 
45 44
     echo '<script>window.location.href="' . str_replace("%DATA%", $data, $toolList[$tool]) . '"</script>';
46
-}
47
-else {
45
+} else {
48 46
     header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true");
49 47
 }
Please login to merge, or discard this patch.
config.inc.php 1 patch
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -196,24 +196,24 @@  discard block
 block discarded – undo
196 196
 
197 197
 // request states
198 198
 $availableRequestStates = array(
199
-    'Open'          => array(
200
-        'defertolog' => 'users', // don't change or you'll break old logs
201
-        'deferto'    => 'users',
202
-        'header'     => 'Open requests',
203
-        'api'        => "open",
204
-    ),
205
-    'Flagged users' => array(
206
-        'defertolog' => 'flagged users', // don't change or you'll break old logs
207
-        'deferto'    => 'flagged users',
208
-        'header'     => 'Flagged user needed',
209
-        'api'        => "admin",
210
-    ),
211
-    'Checkuser'     => array(
212
-        'defertolog' => 'checkusers', // don't change or you'll break old logs
213
-        'deferto'    => 'checkusers',
214
-        'header'     => 'Checkuser needed',
215
-        'api'        => "checkuser",
216
-    ),
199
+	'Open'          => array(
200
+		'defertolog' => 'users', // don't change or you'll break old logs
201
+		'deferto'    => 'users',
202
+		'header'     => 'Open requests',
203
+		'api'        => "open",
204
+	),
205
+	'Flagged users' => array(
206
+		'defertolog' => 'flagged users', // don't change or you'll break old logs
207
+		'deferto'    => 'flagged users',
208
+		'header'     => 'Flagged user needed',
209
+		'api'        => "admin",
210
+	),
211
+	'Checkuser'     => array(
212
+		'defertolog' => 'checkusers', // don't change or you'll break old logs
213
+		'deferto'    => 'checkusers',
214
+		'header'     => 'Checkuser needed',
215
+		'api'        => "checkuser",
216
+	),
217 217
 );
218 218
 
219 219
 $defaultRequestStateKey = 'Open';
@@ -252,21 +252,21 @@  discard block
 block discarded – undo
252 252
 require_once('config.local.inc.php');
253 253
 
254 254
 $cDatabaseConfig = array(
255
-    "acc"           => array(
256
-        "dsrcname" => "mysql:host=" . $toolserver_host . ";dbname=" . $toolserver_database,
257
-        "username" => $toolserver_username,
258
-        "password" => $toolserver_password,
259
-    ),
260
-    "wikipedia"     => array(
261
-        "dsrcname" => "mysql:host=" . $antispoof_host . ";dbname=" . $antispoof_db,
262
-        "username" => $toolserver_username,
263
-        "password" => $toolserver_password,
264
-    ),
265
-    "notifications" => array(
266
-        "dsrcname" => "mysql:host=" . $toolserver_notification_dbhost . ";dbname=" . $toolserver_notification_database,
267
-        "username" => $notifications_username,
268
-        "password" => $notifications_password,
269
-    ),
255
+	"acc"           => array(
256
+		"dsrcname" => "mysql:host=" . $toolserver_host . ";dbname=" . $toolserver_database,
257
+		"username" => $toolserver_username,
258
+		"password" => $toolserver_password,
259
+	),
260
+	"wikipedia"     => array(
261
+		"dsrcname" => "mysql:host=" . $antispoof_host . ";dbname=" . $antispoof_db,
262
+		"username" => $toolserver_username,
263
+		"password" => $toolserver_password,
264
+	),
265
+	"notifications" => array(
266
+		"dsrcname" => "mysql:host=" . $toolserver_notification_dbhost . ";dbname=" . $toolserver_notification_database,
267
+		"username" => $notifications_username,
268
+		"password" => $notifications_password,
269
+	),
270 270
 );
271 271
 
272 272
 // //Keep the included files from being executed.
@@ -278,18 +278,18 @@  discard block
 block discarded – undo
278 278
 ini_set('user_agent', $toolUserAgent);
279 279
 
280 280
 foreach (array(
281
-    "mbstring", // unicode and stuff
282
-    "pdo",
283
-    "pdo_mysql", // new database module
284
-    "session",
285
-    "date",
286
-    "pcre", // core stuff
287
-    "curl", // mediawiki api access etc
288
-    "openssl", // token generation
281
+	"mbstring", // unicode and stuff
282
+	"pdo",
283
+	"pdo_mysql", // new database module
284
+	"session",
285
+	"date",
286
+	"pcre", // core stuff
287
+	"curl", // mediawiki api access etc
288
+	"openssl", // token generation
289 289
 ) as $x) {
290
-    if (!extension_loaded($x)) {
291
-        die("extension $x is required.");
292
-    }
290
+	if (!extension_loaded($x)) {
291
+		die("extension $x is required.");
292
+	}
293 293
 }
294 294
 
295 295
 // Set up the AutoLoader
@@ -316,32 +316,32 @@  discard block
 block discarded – undo
316 316
 $siteConfiguration = new \Waca\SiteConfiguration();
317 317
 
318 318
 $siteConfiguration->setBaseUrl($baseurl)
319
-    ->setFilePath(__DIR__)
320
-    ->setDebuggingTraceEnabled($enableErrorTrace)
321
-    ->setForceIdentification($forceIdentification)
322
-    ->setIdentificationCacheExpiry($identificationCacheExpiry)
323
-    ->setMediawikiScriptPath($mediawikiScriptPath)
324
-    ->setMediawikiWebServiceEndpoint($mediawikiWebServiceEndpoint)
325
-    ->setMetaWikimediaWebServiceEndpoint($metaWikimediaWebServiceEndpoint)
326
-    ->setEnforceOAuth($enforceOAuth)
327
-    ->setEmailConfirmationEnabled($enableEmailConfirm == 1)
328
-    ->setEmailConfirmationExpiryDays($emailConfirmationExpiryDays)
329
-    ->setMiserModeLimit($requestLimitShowOnly)
330
-    ->setRequestStates($availableRequestStates)
331
-    ->setSquidList($squidIpList)
332
-    ->setDefaultCreatedTemplateId($createdid)
333
-    ->setDefaultRequestStateKey($defaultRequestStateKey)
334
-    ->setUseStrictTransportSecurity($strictTransportSecurityExpiry)
335
-    ->setUserAgent($toolUserAgent)
336
-    ->setCurlDisableVerifyPeer($curlDisableSSLVerifyPeer)
337
-    ->setUseOAuthSignup($useOauthSignup)
338
-    ->setOAuthBaseUrl($oauthBaseUrl)
339
-    ->setOAuthConsumerToken($oauthConsumerToken)
340
-    ->setOAuthConsumerSecret($oauthSecretToken)
341
-    ->setDataClearInterval($dataclear_interval)
342
-    ->setXffTrustedHostsFile($xff_trusted_hosts_file)
343
-    ->setIrcNotificationsEnabled($ircBotNotificationsEnabled == 1)
344
-    ->setIrcNotificationType($ircBotNotificationType)
345
-    ->setIrcNotificationsInstance($whichami)
346
-    ->setTitleBlacklistEnabled($enableTitleblacklist == 1)
347
-    ->setTorExitPaths(array_merge(gethostbynamel('en.wikipedia.org'), gethostbynamel('accounts.wmflabs.org')));
319
+	->setFilePath(__DIR__)
320
+	->setDebuggingTraceEnabled($enableErrorTrace)
321
+	->setForceIdentification($forceIdentification)
322
+	->setIdentificationCacheExpiry($identificationCacheExpiry)
323
+	->setMediawikiScriptPath($mediawikiScriptPath)
324
+	->setMediawikiWebServiceEndpoint($mediawikiWebServiceEndpoint)
325
+	->setMetaWikimediaWebServiceEndpoint($metaWikimediaWebServiceEndpoint)
326
+	->setEnforceOAuth($enforceOAuth)
327
+	->setEmailConfirmationEnabled($enableEmailConfirm == 1)
328
+	->setEmailConfirmationExpiryDays($emailConfirmationExpiryDays)
329
+	->setMiserModeLimit($requestLimitShowOnly)
330
+	->setRequestStates($availableRequestStates)
331
+	->setSquidList($squidIpList)
332
+	->setDefaultCreatedTemplateId($createdid)
333
+	->setDefaultRequestStateKey($defaultRequestStateKey)
334
+	->setUseStrictTransportSecurity($strictTransportSecurityExpiry)
335
+	->setUserAgent($toolUserAgent)
336
+	->setCurlDisableVerifyPeer($curlDisableSSLVerifyPeer)
337
+	->setUseOAuthSignup($useOauthSignup)
338
+	->setOAuthBaseUrl($oauthBaseUrl)
339
+	->setOAuthConsumerToken($oauthConsumerToken)
340
+	->setOAuthConsumerSecret($oauthSecretToken)
341
+	->setDataClearInterval($dataclear_interval)
342
+	->setXffTrustedHostsFile($xff_trusted_hosts_file)
343
+	->setIrcNotificationsEnabled($ircBotNotificationsEnabled == 1)
344
+	->setIrcNotificationType($ircBotNotificationType)
345
+	->setIrcNotificationsInstance($whichami)
346
+	->setTitleBlacklistEnabled($enableTitleblacklist == 1)
347
+	->setTorExitPaths(array_merge(gethostbynamel('en.wikipedia.org'), gethostbynamel('accounts.wmflabs.org')));
Please login to merge, or discard this patch.