@@ -13,10 +13,10 @@ |
||
13 | 13 | */ |
14 | 14 | interface ILocationProvider |
15 | 15 | { |
16 | - /** |
|
17 | - * @param string $address IP address |
|
18 | - * |
|
19 | - * @return array |
|
20 | - */ |
|
21 | - public function getIpLocation($address); |
|
16 | + /** |
|
17 | + * @param string $address IP address |
|
18 | + * |
|
19 | + * @return array |
|
20 | + */ |
|
21 | + public function getIpLocation($address); |
|
22 | 22 | } |
@@ -13,12 +13,12 @@ |
||
13 | 13 | */ |
14 | 14 | interface IRDnsProvider |
15 | 15 | { |
16 | - /** |
|
17 | - * Gets the reverse DNS address for an IP |
|
18 | - * |
|
19 | - * @param string $address |
|
20 | - * |
|
21 | - * @return string |
|
22 | - */ |
|
23 | - public function getReverseDNS($address); |
|
16 | + /** |
|
17 | + * Gets the reverse DNS address for an IP |
|
18 | + * |
|
19 | + * @param string $address |
|
20 | + * |
|
21 | + * @return string |
|
22 | + */ |
|
23 | + public function getReverseDNS($address); |
|
24 | 24 | } |
@@ -19,41 +19,41 @@ |
||
19 | 19 | */ |
20 | 20 | interface IXffTrustProvider |
21 | 21 | { |
22 | - /** |
|
23 | - * Returns a value if the IP address is a trusted proxy |
|
24 | - * |
|
25 | - * @param string $ip |
|
26 | - * |
|
27 | - * @return bool |
|
28 | - */ |
|
29 | - public function isTrusted($ip); |
|
22 | + /** |
|
23 | + * Returns a value if the IP address is a trusted proxy |
|
24 | + * |
|
25 | + * @param string $ip |
|
26 | + * |
|
27 | + * @return bool |
|
28 | + */ |
|
29 | + public function isTrusted($ip); |
|
30 | 30 | |
31 | - /** |
|
32 | - * Gets the last trusted IP in the proxy chain. |
|
33 | - * |
|
34 | - * @param string $ip The IP address from REMOTE_ADDR |
|
35 | - * @param string $proxyIp The contents of the XFF header. |
|
36 | - * |
|
37 | - * @return string Trusted source IP address |
|
38 | - */ |
|
39 | - public function getTrustedClientIp($ip, $proxyIp); |
|
31 | + /** |
|
32 | + * Gets the last trusted IP in the proxy chain. |
|
33 | + * |
|
34 | + * @param string $ip The IP address from REMOTE_ADDR |
|
35 | + * @param string $proxyIp The contents of the XFF header. |
|
36 | + * |
|
37 | + * @return string Trusted source IP address |
|
38 | + */ |
|
39 | + public function getTrustedClientIp($ip, $proxyIp); |
|
40 | 40 | |
41 | - /** |
|
42 | - * Takes an array( "low" => "high" ) values, and returns true if $needle is in at least one of them. |
|
43 | - * |
|
44 | - * @param array $haystack |
|
45 | - * @param string $ip |
|
46 | - * |
|
47 | - * @return bool |
|
48 | - */ |
|
49 | - public function ipInRange($haystack, $ip); |
|
41 | + /** |
|
42 | + * Takes an array( "low" => "high" ) values, and returns true if $needle is in at least one of them. |
|
43 | + * |
|
44 | + * @param array $haystack |
|
45 | + * @param string $ip |
|
46 | + * |
|
47 | + * @return bool |
|
48 | + */ |
|
49 | + public function ipInRange($haystack, $ip); |
|
50 | 50 | |
51 | - /** |
|
52 | - * Explodes a CIDR range into an array of addresses |
|
53 | - * |
|
54 | - * @param string $range A CIDR-format range |
|
55 | - * |
|
56 | - * @return array An array containing every IP address in the range |
|
57 | - */ |
|
58 | - public function explodeCidr($range); |
|
51 | + /** |
|
52 | + * Explodes a CIDR range into an array of addresses |
|
53 | + * |
|
54 | + * @param string $range A CIDR-format range |
|
55 | + * |
|
56 | + * @return array An array containing every IP address in the range |
|
57 | + */ |
|
58 | + public function explodeCidr($range); |
|
59 | 59 | } |
@@ -13,10 +13,10 @@ |
||
13 | 13 | */ |
14 | 14 | interface IAntiSpoofProvider |
15 | 15 | { |
16 | - /** |
|
17 | - * @param string $username |
|
18 | - * |
|
19 | - * @return array |
|
20 | - */ |
|
21 | - public function getSpoofs($username); |
|
16 | + /** |
|
17 | + * @param string $username |
|
18 | + * |
|
19 | + * @return array |
|
20 | + */ |
|
21 | + public function getSpoofs($username); |
|
22 | 22 | } |
@@ -15,72 +15,72 @@ |
||
15 | 15 | |
16 | 16 | class ConsoleStart extends ApplicationBase |
17 | 17 | { |
18 | - /** |
|
19 | - * @var ConsoleTaskBase |
|
20 | - */ |
|
21 | - private $consoleTask; |
|
18 | + /** |
|
19 | + * @var ConsoleTaskBase |
|
20 | + */ |
|
21 | + private $consoleTask; |
|
22 | 22 | |
23 | - /** |
|
24 | - * ConsoleStart constructor. |
|
25 | - * |
|
26 | - * @param SiteConfiguration $configuration |
|
27 | - * @param ConsoleTaskBase $consoleTask |
|
28 | - */ |
|
29 | - public function __construct(SiteConfiguration $configuration, ConsoleTaskBase $consoleTask) |
|
30 | - { |
|
31 | - parent::__construct($configuration); |
|
32 | - $this->consoleTask = $consoleTask; |
|
33 | - } |
|
23 | + /** |
|
24 | + * ConsoleStart constructor. |
|
25 | + * |
|
26 | + * @param SiteConfiguration $configuration |
|
27 | + * @param ConsoleTaskBase $consoleTask |
|
28 | + */ |
|
29 | + public function __construct(SiteConfiguration $configuration, ConsoleTaskBase $consoleTask) |
|
30 | + { |
|
31 | + parent::__construct($configuration); |
|
32 | + $this->consoleTask = $consoleTask; |
|
33 | + } |
|
34 | 34 | |
35 | - protected function setupEnvironment() |
|
36 | - { |
|
37 | - // initialise super-global providers |
|
38 | - WebRequest::setGlobalStateProvider(new FakeGlobalStateProvider()); |
|
35 | + protected function setupEnvironment() |
|
36 | + { |
|
37 | + // initialise super-global providers |
|
38 | + WebRequest::setGlobalStateProvider(new FakeGlobalStateProvider()); |
|
39 | 39 | |
40 | - if (WebRequest::method() !== null) { |
|
41 | - throw new EnvironmentException('This is a console task, which cannot be executed via the web.'); |
|
42 | - } |
|
40 | + if (WebRequest::method() !== null) { |
|
41 | + throw new EnvironmentException('This is a console task, which cannot be executed via the web.'); |
|
42 | + } |
|
43 | 43 | |
44 | - return parent::setupEnvironment(); |
|
45 | - } |
|
44 | + return parent::setupEnvironment(); |
|
45 | + } |
|
46 | 46 | |
47 | - protected function cleanupEnvironment() |
|
48 | - { |
|
49 | - } |
|
47 | + protected function cleanupEnvironment() |
|
48 | + { |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * Main application logic |
|
53 | - */ |
|
54 | - protected function main() |
|
55 | - { |
|
56 | - $database = PdoDatabase::getDatabaseConnection('acc'); |
|
51 | + /** |
|
52 | + * Main application logic |
|
53 | + */ |
|
54 | + protected function main() |
|
55 | + { |
|
56 | + $database = PdoDatabase::getDatabaseConnection('acc'); |
|
57 | 57 | |
58 | - if ($this->getConfiguration()->getIrcNotificationsEnabled()) { |
|
59 | - $notificationsDatabase = PdoDatabase::getDatabaseConnection('notifications'); |
|
60 | - } |
|
61 | - else { |
|
62 | - // pass through null |
|
63 | - $notificationsDatabase = null; |
|
64 | - } |
|
58 | + if ($this->getConfiguration()->getIrcNotificationsEnabled()) { |
|
59 | + $notificationsDatabase = PdoDatabase::getDatabaseConnection('notifications'); |
|
60 | + } |
|
61 | + else { |
|
62 | + // pass through null |
|
63 | + $notificationsDatabase = null; |
|
64 | + } |
|
65 | 65 | |
66 | - $this->setupHelpers($this->consoleTask, $this->getConfiguration(), $database, $notificationsDatabase); |
|
66 | + $this->setupHelpers($this->consoleTask, $this->getConfiguration(), $database, $notificationsDatabase); |
|
67 | 67 | |
68 | - // initialise a database transaction |
|
69 | - if (!$database->beginTransaction()) { |
|
70 | - throw new Exception('Failed to start transaction on primary database.'); |
|
71 | - } |
|
68 | + // initialise a database transaction |
|
69 | + if (!$database->beginTransaction()) { |
|
70 | + throw new Exception('Failed to start transaction on primary database.'); |
|
71 | + } |
|
72 | 72 | |
73 | - try { |
|
74 | - // run the task |
|
75 | - $this->consoleTask->execute(); |
|
73 | + try { |
|
74 | + // run the task |
|
75 | + $this->consoleTask->execute(); |
|
76 | 76 | |
77 | - $database->commit(); |
|
78 | - } |
|
79 | - finally { |
|
80 | - // Catch any hanging on transactions |
|
81 | - if ($database->hasActiveTransaction()) { |
|
82 | - $database->rollBack(); |
|
83 | - } |
|
84 | - } |
|
85 | - } |
|
77 | + $database->commit(); |
|
78 | + } |
|
79 | + finally { |
|
80 | + // Catch any hanging on transactions |
|
81 | + if ($database->hasActiveTransaction()) { |
|
82 | + $database->rollBack(); |
|
83 | + } |
|
84 | + } |
|
85 | + } |
|
86 | 86 | } |
87 | 87 | \ No newline at end of file |
@@ -13,21 +13,21 @@ |
||
13 | 13 | */ |
14 | 14 | class Environment |
15 | 15 | { |
16 | - /** |
|
17 | - * @var string Cached copy of the tool version |
|
18 | - */ |
|
19 | - private static $toolVersion = null; |
|
16 | + /** |
|
17 | + * @var string Cached copy of the tool version |
|
18 | + */ |
|
19 | + private static $toolVersion = null; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Gets the tool version, using cached data if available. |
|
23 | - * @return string |
|
24 | - */ |
|
25 | - public static function getToolVersion() |
|
26 | - { |
|
27 | - if (self::$toolVersion === null) { |
|
28 | - self::$toolVersion = exec("git describe --always --dirty"); |
|
29 | - } |
|
21 | + /** |
|
22 | + * Gets the tool version, using cached data if available. |
|
23 | + * @return string |
|
24 | + */ |
|
25 | + public static function getToolVersion() |
|
26 | + { |
|
27 | + if (self::$toolVersion === null) { |
|
28 | + self::$toolVersion = exec("git describe --always --dirty"); |
|
29 | + } |
|
30 | 30 | |
31 | - return self::$toolVersion; |
|
32 | - } |
|
31 | + return self::$toolVersion; |
|
32 | + } |
|
33 | 33 | } |
@@ -7,7 +7,7 @@ discard block |
||
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 |
||
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"; |
@@ -41,8 +41,8 @@ |
||
41 | 41 | $data = htmlentities($data, ENT_COMPAT, 'UTF-8'); |
42 | 42 | } |
43 | 43 | |
44 | - echo '<script>window.location.href="' . str_replace("%DATA%", $data, $toolList[$tool]) . '"</script>'; |
|
44 | + echo '<script>window.location.href="'.str_replace("%DATA%", $data, $toolList[$tool]).'"</script>'; |
|
45 | 45 | } |
46 | 46 | else { |
47 | - header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true"); |
|
47 | + header("Location: ".$_SERVER["REQUEST_URI"]."&round2=true"); |
|
48 | 48 | } |
@@ -7,43 +7,43 @@ |
||
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 | } |
@@ -16,68 +16,68 @@ |
||
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 |
@@ -50,25 +50,25 @@ discard block |
||
50 | 50 | $pluralise = false; |
51 | 51 | } |
52 | 52 | elseif ($secs > 10 && $secs < $minuteCut) { |
53 | - $output = round($secs / $second) . " second"; |
|
53 | + $output = round($secs / $second)." second"; |
|
54 | 54 | } |
55 | 55 | elseif ($secs >= $minuteCut && $secs < $hourCut) { |
56 | - $output = round($secs / $minute) . " minute"; |
|
56 | + $output = round($secs / $minute)." minute"; |
|
57 | 57 | } |
58 | 58 | elseif ($secs >= $hourCut && $secs < $dayCut) { |
59 | - $output = round($secs / $hour) . " hour"; |
|
59 | + $output = round($secs / $hour)." hour"; |
|
60 | 60 | } |
61 | 61 | elseif ($secs >= $dayCut && $secs < $weekCut) { |
62 | - $output = round($secs / $day) . " day"; |
|
62 | + $output = round($secs / $day)." day"; |
|
63 | 63 | } |
64 | 64 | elseif ($secs >= $weekCut && $secs < $monthCut) { |
65 | - $output = round($secs / $week) . " week"; |
|
65 | + $output = round($secs / $week)." week"; |
|
66 | 66 | } |
67 | 67 | elseif ($secs >= $monthCut && $secs < $yearCut) { |
68 | - $output = round($secs / $month) . " month"; |
|
68 | + $output = round($secs / $month)." month"; |
|
69 | 69 | } |
70 | 70 | elseif ($secs >= $yearCut && $secs < $year * 10) { |
71 | - $output = round($secs / $year) . " year"; |
|
71 | + $output = round($secs / $year)." year"; |
|
72 | 72 | } |
73 | 73 | else { |
74 | 74 | $output = "a long time ago"; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | if ($pluralise) { |
79 | - $output = (substr($output, 0, 2) <> "1 ") ? $output . "s ago" : $output . " ago"; |
|
79 | + $output = (substr($output, 0, 2) <> "1 ") ? $output."s ago" : $output." ago"; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | return $output; |