@@ -23,7 +23,7 @@ |
||
23 | 23 | * @return bool Always returns true |
24 | 24 | */ |
25 | 25 | public function execute() |
26 | - { |
|
26 | + { |
|
27 | 27 | global $txt, $smcFunc, $txtBirthdayEmails, $modSettings, $sourcedir; |
28 | 28 | |
29 | 29 | $greeting = isset($modSettings['birthday_email']) ? $modSettings['birthday_email'] : 'happy_birthday'; |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @return bool Always returns true |
25 | 25 | */ |
26 | 26 | public function execute() |
27 | - { |
|
27 | + { |
|
28 | 28 | global $sourcedir, $smcFunc, $user_profile; |
29 | 29 | |
30 | 30 | // Get everyone who could be notified - those are the people who can see the calendar. |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * @return bool Always returns true |
24 | 24 | */ |
25 | 25 | public function execute() |
26 | - { |
|
26 | + { |
|
27 | 27 | global $smcFunc, $sourcedir; |
28 | 28 | |
29 | 29 | // Figure out if the user wants to be notified. |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @return bool Always returns true. |
25 | 25 | */ |
26 | 26 | public function execute() |
27 | - { |
|
27 | + { |
|
28 | 28 | global $sourcedir, $smcFunc, $language, $modSettings, $scripturl; |
29 | 29 | |
30 | 30 | // Do we have any group moderators? |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * @return bool Always returns true |
24 | 24 | */ |
25 | 25 | public function execute() |
26 | - { |
|
26 | + { |
|
27 | 27 | global $sourcedir; |
28 | 28 | |
29 | 29 | require_once($sourcedir . '/Subs.php'); |
@@ -64,7 +64,8 @@ discard block |
||
64 | 64 | { |
65 | 65 | $this->buildLookup(); |
66 | 66 | |
67 | - if ($initKey !== null) { |
|
67 | + if ($initKey !== null) |
|
68 | + { |
|
68 | 69 | $this->setInitKey($initKey); |
69 | 70 | } |
70 | 71 | } |
@@ -98,7 +99,8 @@ discard block |
||
98 | 99 | */ |
99 | 100 | public function setRange($range) |
100 | 101 | { |
101 | - if (!is_numeric($range)) { |
|
102 | + if (!is_numeric($range)) |
|
103 | + { |
|
102 | 104 | throw new \InvalidArgumentException('Invalid window range'); |
103 | 105 | } |
104 | 106 | $this->range = $range; |
@@ -114,7 +116,8 @@ discard block |
||
114 | 116 | */ |
115 | 117 | public function setInitKey($key) |
116 | 118 | { |
117 | - if (preg_match('/^[' . implode('', array_keys($this->getLookup())) . ']+$/', $key) == false) { |
|
119 | + if (preg_match('/^[' . implode('', array_keys($this->getLookup())) . ']+$/', $key) == false) |
|
120 | + { |
|
118 | 121 | throw new \InvalidArgumentException('Invalid base32 hash!'); |
119 | 122 | } |
120 | 123 | $this->initKey = $key; |
@@ -140,7 +143,8 @@ discard block |
||
140 | 143 | */ |
141 | 144 | public function setLookup($lookup) |
142 | 145 | { |
143 | - if (!is_array($lookup)) { |
|
146 | + if (!is_array($lookup)) |
|
147 | + { |
|
144 | 148 | throw new \InvalidArgumentException('Lookup value must be an array'); |
145 | 149 | } |
146 | 150 | $this->lookup = $lookup; |
@@ -176,7 +180,8 @@ discard block |
||
176 | 180 | */ |
177 | 181 | public function setRefresh($seconds) |
178 | 182 | { |
179 | - if (!is_numeric($seconds)) { |
|
183 | + if (!is_numeric($seconds)) |
|
184 | + { |
|
180 | 185 | throw new \InvalidArgumentException('Seconds must be numeric'); |
181 | 186 | } |
182 | 187 | $this->refreshSeconds = $seconds; |
@@ -217,7 +222,8 @@ discard block |
||
217 | 222 | */ |
218 | 223 | public function validateCode($code, $initKey = null, $timestamp = null, $range = null) |
219 | 224 | { |
220 | - if (strlen($code) !== $this->getCodeLength()) { |
|
225 | + if (strlen($code) !== $this->getCodeLength()) |
|
226 | + { |
|
221 | 227 | throw new \InvalidArgumentException('Incorrect code length'); |
222 | 228 | } |
223 | 229 | |
@@ -227,8 +233,10 @@ discard block |
||
227 | 233 | |
228 | 234 | $binary = $this->base32_decode($initKey); |
229 | 235 | |
230 | - for ($time = ($timestamp - $range); $time <= ($timestamp + $range); $time++) { |
|
231 | - if ($this->generateOneTime($binary, $time) == $code) { |
|
236 | + for ($time = ($timestamp - $range); $time <= ($timestamp + $range); $time++) |
|
237 | + { |
|
238 | + if ($this->generateOneTime($binary, $time) == $code) |
|
239 | + { |
|
232 | 240 | return true; |
233 | 241 | } |
234 | 242 | } |
@@ -271,7 +279,8 @@ discard block |
||
271 | 279 | $lookup = implode('', array_keys($this->getLookup())); |
272 | 280 | $code = ''; |
273 | 281 | |
274 | - for ($i = 0; $i < $length; $i++) { |
|
282 | + for ($i = 0; $i < $length; $i++) |
|
283 | + { |
|
275 | 284 | $code .= $lookup[$smcFunc['random_int'](0, strlen($lookup) - 1)]; |
276 | 285 | } |
277 | 286 | |
@@ -317,7 +326,8 @@ discard block |
||
317 | 326 | { |
318 | 327 | $lookup = $this->getLookup(); |
319 | 328 | |
320 | - if (preg_match('/^[' . implode('', array_keys($lookup)) . ']+$/', $hash) == false) { |
|
329 | + if (preg_match('/^[' . implode('', array_keys($lookup)) . ']+$/', $hash) == false) |
|
330 | + { |
|
321 | 331 | throw new \InvalidArgumentException('Invalid base32 hash!'); |
322 | 332 | } |
323 | 333 | |
@@ -326,12 +336,14 @@ discard block |
||
326 | 336 | $length = 0; |
327 | 337 | $binary = ''; |
328 | 338 | |
329 | - for ($i = 0; $i < strlen($hash); $i++) { |
|
339 | + for ($i = 0; $i < strlen($hash); $i++) |
|
340 | + { |
|
330 | 341 | $buffer = $buffer << 5; |
331 | 342 | $buffer += $lookup[$hash[$i]]; |
332 | 343 | $length += 5; |
333 | 344 | |
334 | - if ($length >= 8) { |
|
345 | + if ($length >= 8) |
|
346 | + { |
|
335 | 347 | $length -= 8; |
336 | 348 | $binary .= chr(($buffer & (0xFF << $length)) >> $length); |
337 | 349 | } |
@@ -1076,7 +1076,8 @@ |
||
1076 | 1076 | { |
1077 | 1077 | unset($topics[$row['id_topic']]); // If we can't see it, we should not merge it and not adjust counts! Instead skip it. |
1078 | 1078 | continue; |
1079 | - }elseif (!$row['approved']) |
|
1079 | + } |
|
1080 | + elseif (!$row['approved']) |
|
1080 | 1081 | $boardTotals[$row['id_board']]['unapproved_topics']++; |
1081 | 1082 | else |
1082 | 1083 | $boardTotals[$row['id_board']]['topics']++; |
@@ -223,7 +223,8 @@ discard block |
||
223 | 223 | checkSession('get'); |
224 | 224 | validateToken('admin-msm', 'get'); |
225 | 225 | |
226 | - if ($db_type == 'postgresql') { |
|
226 | + if ($db_type == 'postgresql') |
|
227 | + { |
|
227 | 228 | $smcFunc['db_query']('', ' |
228 | 229 | DROP INDEX IF EXISTS {db_prefix}messages_ftx', |
229 | 230 | array( |
@@ -787,7 +788,8 @@ discard block |
||
787 | 788 | // We need this for db_get_version |
788 | 789 | db_extend(); |
789 | 790 | |
790 | - if ($smcFunc['db_title'] == 'PostgreSQL') { |
|
791 | + if ($smcFunc['db_title'] == 'PostgreSQL') |
|
792 | + { |
|
791 | 793 | $request = $smcFunc['db_query']('', ' |
792 | 794 | SELECT |
793 | 795 | indexname |
@@ -1281,7 +1281,9 @@ |
||
1281 | 1281 | // File Upload. |
1282 | 1282 | if ($context['can_post_attachment']) |
1283 | 1283 | { |
1284 | - $acceptedFiles = implode(',', array_map(function($val) use($smcFunc) { return '.' . $smcFunc['htmltrim']($val); } , explode(',', $context['allowed_extensions']))); |
|
1284 | + $acceptedFiles = implode(',', array_map(function($val) use($smcFunc) |
|
1285 | + { |
|
1286 | +return '.' . $smcFunc['htmltrim']($val); } , explode(',', $context['allowed_extensions']))); |
|
1285 | 1287 | |
1286 | 1288 | loadJavaScriptFile('dropzone.min.js', array('defer' => true), 'smf_dropzone'); |
1287 | 1289 | loadJavaScriptFile('smf_fileUpload.js', array('defer' => true, 'minimize' => true), 'smf_fileUpload'); |