@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | // add to top |
86 | - $content = implode('', $matches[0]).$content; |
|
86 | + $content = implode('', $matches[0]) . $content; |
|
87 | 87 | }; |
88 | 88 | |
89 | 89 | return $content; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | // loop the matches |
209 | 209 | foreach ($matches as $match) { |
210 | 210 | // get the path for the file that will be imported |
211 | - $importPath = dirname($source).'/'.$match['path']; |
|
211 | + $importPath = dirname($source) . '/' . $match['path']; |
|
212 | 212 | |
213 | 213 | // only replace the import with the content if we can grab the |
214 | 214 | // content of the file |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | // check if current file was not imported previously in the same |
217 | 217 | // import chain. |
218 | 218 | if (in_array($importPath, $parents)) { |
219 | - throw new FileImportException('Failed to import file "'.$importPath.'": circular reference detected.'); |
|
219 | + throw new FileImportException('Failed to import file "' . $importPath . '": circular reference detected.'); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | // grab referenced file & minify it (which may include importing |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | |
227 | 227 | // check if this is only valid for certain media |
228 | 228 | if (!empty($match['media'])) { |
229 | - $importContent = '@media '.$match['media'].'{'.$importContent.'}'; |
|
229 | + $importContent = '@media ' . $match['media'] . '{' . $importContent . '}'; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | // add to replacement array |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | protected function importFiles($source, $content) |
256 | 256 | { |
257 | 257 | $extensions = array_keys($this->importExtensions); |
258 | - $regex = '/url\((["\']?)((?!["\']?data:).*?\.('.implode('|', $extensions).'))\\1\)/i'; |
|
258 | + $regex = '/url\((["\']?)((?!["\']?data:).*?\.(' . implode('|', $extensions) . '))\\1\)/i'; |
|
259 | 259 | if ($extensions && preg_match_all($regex, $content, $matches, PREG_SET_ORDER)) { |
260 | 260 | $search = array(); |
261 | 261 | $replace = array(); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | foreach ($matches as $match) { |
265 | 265 | // get the path for the file that will be imported |
266 | 266 | $path = $match[2]; |
267 | - $path = dirname($source).'/'.$path; |
|
267 | + $path = dirname($source) . '/' . $path; |
|
268 | 268 | $extension = $match[3]; |
269 | 269 | |
270 | 270 | // only replace the import with the content if we're able to get |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | |
277 | 277 | // build replacement |
278 | 278 | $search[] = $match[0]; |
279 | - $replace[] = 'url('.$this->importExtensions[$extension].';base64,'.$importContent.')'; |
|
279 | + $replace[] = 'url(' . $this->importExtensions[$extension] . ';base64,' . $importContent . ')'; |
|
280 | 280 | } |
281 | 281 | } |
282 | 282 | |
@@ -463,9 +463,9 @@ discard block |
||
463 | 463 | // build replacement |
464 | 464 | $search[] = $match[0]; |
465 | 465 | if ($type == 'url') { |
466 | - $replace[] = 'url('.$url.')'; |
|
466 | + $replace[] = 'url(' . $url . ')'; |
|
467 | 467 | } elseif ($type == 'import') { |
468 | - $replace[] = '@import "'.$url.'"'; |
|
468 | + $replace[] = '@import "' . $url . '"'; |
|
469 | 469 | } |
470 | 470 | } |
471 | 471 | |
@@ -513,19 +513,19 @@ discard block |
||
513 | 513 | // practice, Webkit (especially Safari) seems to stumble over at least |
514 | 514 | // 0%, potentially other units as well. Only stripping 'px' for now. |
515 | 515 | // @see https://github.com/matthiasmullie/minify/issues/60 |
516 | - $content = preg_replace('/'.$before.'(-?0*(\.0+)?)(?<=0)px'.$after.'/', '\\1', $content); |
|
516 | + $content = preg_replace('/' . $before . '(-?0*(\.0+)?)(?<=0)px' . $after . '/', '\\1', $content); |
|
517 | 517 | |
518 | 518 | // strip 0-digits (.0 -> 0) |
519 | - $content = preg_replace('/'.$before.'\.0+'.$units.'?'.$after.'/', '0\\1', $content); |
|
519 | + $content = preg_replace('/' . $before . '\.0+' . $units . '?' . $after . '/', '0\\1', $content); |
|
520 | 520 | // strip trailing 0: 50.10 -> 50.1, 50.10px -> 50.1px |
521 | - $content = preg_replace('/'.$before.'(-?[0-9]+\.[0-9]+)0+'.$units.'?'.$after.'/', '\\1\\2', $content); |
|
521 | + $content = preg_replace('/' . $before . '(-?[0-9]+\.[0-9]+)0+' . $units . '?' . $after . '/', '\\1\\2', $content); |
|
522 | 522 | // strip trailing 0: 50.00 -> 50, 50.00px -> 50px |
523 | - $content = preg_replace('/'.$before.'(-?[0-9]+)\.0+'.$units.'?'.$after.'/', '\\1\\2', $content); |
|
523 | + $content = preg_replace('/' . $before . '(-?[0-9]+)\.0+' . $units . '?' . $after . '/', '\\1\\2', $content); |
|
524 | 524 | // strip leading 0: 0.1 -> .1, 01.1 -> 1.1 |
525 | - $content = preg_replace('/'.$before.'(-?)0+([0-9]*\.[0-9]+)'.$units.'?'.$after.'/', '\\1\\2\\3', $content); |
|
525 | + $content = preg_replace('/' . $before . '(-?)0+([0-9]*\.[0-9]+)' . $units . '?' . $after . '/', '\\1\\2\\3', $content); |
|
526 | 526 | |
527 | 527 | // strip negative zeroes (-0 -> 0) & truncate zeroes (00 -> 0) |
528 | - $content = preg_replace('/'.$before.'-?0+'.$units.'?'.$after.'/', '0\\1', $content); |
|
528 | + $content = preg_replace('/' . $before . '-?0+' . $units . '?' . $after . '/', '0\\1', $content); |
|
529 | 529 | |
530 | 530 | return $content; |
531 | 531 | } |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | // when both paths have nothing in common, one of them is probably |
40 | 40 | // absolute while the other is relative |
41 | 41 | $cwd = getcwd(); |
42 | - $from = strpos($from, $cwd) === 0 ? $from : $cwd.'/'.$from; |
|
43 | - $to = strpos($to, $cwd) === 0 ? $to : $cwd.'/'.$to; |
|
42 | + $from = strpos($from, $cwd) === 0 ? $from : $cwd . '/' . $from; |
|
43 | + $to = strpos($to, $cwd) === 0 ? $to : $cwd . '/' . $to; |
|
44 | 44 | |
45 | 45 | // or traveling the tree via `..` |
46 | 46 | // attempt to resolve path, or assume it's fine if it doesn't exist |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | // normalize paths |
150 | - $path = $this->normalize($this->from.'/'.$path); |
|
150 | + $path = $this->normalize($this->from . '/' . $path); |
|
151 | 151 | |
152 | 152 | // strip shared ancestor paths |
153 | 153 | $shared = $this->shared($path, $this->to); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | // add .. for every directory that needs to be traversed to new path |
158 | 158 | $to = str_repeat('../', mb_substr_count($to, '/')); |
159 | 159 | |
160 | - return $to.ltrim($path, '/'); |
|
160 | + return $to . ltrim($path, '/'); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | { |
107 | 107 | call_user_func_array(array('parent', '__construct'), func_get_args()); |
108 | 108 | |
109 | - $dataDir = __DIR__.'/../data/js/'; |
|
109 | + $dataDir = __DIR__ . '/../data/js/'; |
|
110 | 110 | $options = FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES; |
111 | - $this->keywordsReserved = file($dataDir.'keywords_reserved.txt', $options); |
|
112 | - $this->keywordsBefore = file($dataDir.'keywords_before.txt', $options); |
|
113 | - $this->keywordsAfter = file($dataDir.'keywords_after.txt', $options); |
|
114 | - $this->operatorsBefore = file($dataDir.'operators_before.txt', $options); |
|
115 | - $this->operatorsAfter = file($dataDir.'operators_after.txt', $options); |
|
111 | + $this->keywordsReserved = file($dataDir . 'keywords_reserved.txt', $options); |
|
112 | + $this->keywordsBefore = file($dataDir . 'keywords_before.txt', $options); |
|
113 | + $this->keywordsAfter = file($dataDir . 'keywords_after.txt', $options); |
|
114 | + $this->operatorsBefore = file($dataDir . 'operators_before.txt', $options); |
|
115 | + $this->operatorsAfter = file($dataDir . 'operators_after.txt', $options); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * singe-line comment on the last line (in which case it would also |
138 | 138 | * be seen as part of that comment) |
139 | 139 | */ |
140 | - $content .= $js."\n;"; |
|
140 | + $content .= $js . "\n;"; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /* |
@@ -202,9 +202,9 @@ discard block |
||
202 | 202 | { |
203 | 203 | // PHP only supports $this inside anonymous functions since 5.4 |
204 | 204 | $minifier = $this; |
205 | - $callback = function ($match) use ($minifier) { |
|
205 | + $callback = function($match) use ($minifier) { |
|
206 | 206 | $count = count($minifier->extracted); |
207 | - $placeholder = '/'.$count.'/'; |
|
207 | + $placeholder = '/' . $count . '/'; |
|
208 | 208 | $minifier->extracted[$placeholder] = $match[1]; |
209 | 209 | |
210 | 210 | return $placeholder; |
@@ -219,11 +219,11 @@ discard block |
||
219 | 219 | // it's going to be division |
220 | 220 | // checking for that is complex, so we'll do inverse: |
221 | 221 | // * at the beginning of the file, it's not division, but regex |
222 | - $this->registerPattern('/^\s*\K'.$pattern.'/', $callback); |
|
222 | + $this->registerPattern('/^\s*\K' . $pattern . '/', $callback); |
|
223 | 223 | // * following another operator, it's not division, but regex |
224 | 224 | $operators = $this->getOperatorsForRegex($this->operatorsBefore, '/'); |
225 | 225 | $operators += $this->getKeywordsForRegex($this->keywordsReserved, '/'); |
226 | - $this->registerPattern('/(?:'.implode('|', $operators).')\s*\K'.$pattern.'/', $callback); |
|
226 | + $this->registerPattern('/(?:' . implode('|', $operators) . ')\s*\K' . $pattern . '/', $callback); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | unset($before['+'], $before['-'], $after['+'], $after['-']); |
266 | 266 | $content = preg_replace( |
267 | 267 | array( |
268 | - '/('.implode('|', $before).')\s+/', |
|
269 | - '/\s+('.implode('|', $after).')/', |
|
268 | + '/(' . implode('|', $before) . ')\s+/', |
|
269 | + '/\s+(' . implode('|', $after) . ')/', |
|
270 | 270 | ), '\\1', $content |
271 | 271 | ); |
272 | 272 | |
@@ -284,13 +284,13 @@ discard block |
||
284 | 284 | * strip the newlines. However, we can safely strip any non-line feed |
285 | 285 | * whitespace that follows them. |
286 | 286 | */ |
287 | - $content = preg_replace('/([\}\)\]])[^\S\n]+(?!'.implode('|', $operators).')/', '\\1', $content); |
|
287 | + $content = preg_replace('/([\}\)\]])[^\S\n]+(?!' . implode('|', $operators) . ')/', '\\1', $content); |
|
288 | 288 | |
289 | 289 | // collapse whitespace around reserved words into single space |
290 | 290 | $before = $this->getKeywordsForRegex($this->keywordsBefore, '/'); |
291 | 291 | $after = $this->getKeywordsForRegex($this->keywordsAfter, '/'); |
292 | - $content = preg_replace('/(^|[;\}\s])\K('.implode('|', $before).')\s+/', '\\2 ', $content); |
|
293 | - $content = preg_replace('/\s+('.implode('|', $after).')(?=([;\{\s]|$))/', ' \\1', $content); |
|
292 | + $content = preg_replace('/(^|[;\}\s])\K(' . implode('|', $before) . ')\s+/', '\\2 ', $content); |
|
293 | + $content = preg_replace('/\s+(' . implode('|', $after) . ')(?=([;\{\s]|$))/', ' \\1', $content); |
|
294 | 294 | |
295 | 295 | /* |
296 | 296 | * Get rid of double semicolons, except where they can be used like: |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | |
365 | 365 | // don't confuse = with other assignment shortcuts (e.g. +=) |
366 | 366 | $chars = preg_quote('+-*\=<>%&|'); |
367 | - $operators['='] = '(?<!['.$chars.'])\='; |
|
367 | + $operators['='] = '(?<![' . $chars . '])\='; |
|
368 | 368 | |
369 | 369 | return $operators; |
370 | 370 | } |
@@ -385,8 +385,8 @@ discard block |
||
385 | 385 | $escaped = array_map('preg_quote', $keywords, $delimiter); |
386 | 386 | |
387 | 387 | // add word boundaries |
388 | - array_walk($keywords, function ($value) { |
|
389 | - return '\b'.$value.'\b'; |
|
388 | + array_walk($keywords, function($value) { |
|
389 | + return '\b' . $value . '\b'; |
|
390 | 390 | }); |
391 | 391 | |
392 | 392 | $keywords = array_combine($keywords, $escaped); |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | // PHP only supports $this inside anonymous functions since 5.4 |
407 | 407 | $minifier = $this; |
408 | 408 | $keywords = $this->keywordsReserved; |
409 | - $callback = function ($match) use ($minifier, $keywords) { |
|
409 | + $callback = function($match) use ($minifier, $keywords) { |
|
410 | 410 | $property = trim($minifier->extracted[$match[1]], '\'"'); |
411 | 411 | |
412 | 412 | /* |
@@ -423,11 +423,11 @@ discard block |
||
423 | 423 | * array['key-here'] can't be replaced by array.key-here since '-' |
424 | 424 | * is not a valid character there. |
425 | 425 | */ |
426 | - if (!preg_match('/^'.$minifier::REGEX_VARIABLE.'$/u', $property)) { |
|
426 | + if (!preg_match('/^' . $minifier::REGEX_VARIABLE . '$/u', $property)) { |
|
427 | 427 | return $match[0]; |
428 | 428 | } |
429 | 429 | |
430 | - return '.'.$property; |
|
430 | + return '.' . $property; |
|
431 | 431 | }; |
432 | 432 | |
433 | 433 | /* |
@@ -448,9 +448,9 @@ discard block |
||
448 | 448 | * separate look-behind assertions, one for each keyword. |
449 | 449 | */ |
450 | 450 | $keywords = $this->getKeywordsForRegex($keywords); |
451 | - $keywords = '(?<!'.implode(')(?<!', $keywords).')'; |
|
451 | + $keywords = '(?<!' . implode(')(?<!', $keywords) . ')'; |
|
452 | 452 | |
453 | - return preg_replace_callback('/(?<='.$previousChar.'|\])'.$keywords.'\[(([\'"])[0-9]+\\2)\]/u', $callback, $content); |
|
453 | + return preg_replace_callback('/(?<=' . $previousChar . '|\])' . $keywords . '\[(([\'"])[0-9]+\\2)\]/u', $callback, $content); |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | /** |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | { |
317 | 317 | // PHP only supports $this inside anonymous functions since 5.4 |
318 | 318 | $minifier = $this; |
319 | - $callback = function ($match) use ($minifier) { |
|
319 | + $callback = function($match) use ($minifier) { |
|
320 | 320 | // check the second index here, because the first always contains a quote |
321 | 321 | if (!$match[2]) { |
322 | 322 | /* |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | } |
330 | 330 | |
331 | 331 | $count = count($minifier->extracted); |
332 | - $placeholder = $match[1].$count.$match[1]; |
|
333 | - $minifier->extracted[$placeholder] = $match[1].$match[2].$match[1]; |
|
332 | + $placeholder = $match[1] . $count . $match[1]; |
|
333 | + $minifier->extracted[$placeholder] = $match[1] . $match[2] . $match[1]; |
|
334 | 334 | |
335 | 335 | return $placeholder; |
336 | 336 | }; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | * considered as escape-char (times 2) and to get it in the regex, |
348 | 348 | * escaped (times 2) |
349 | 349 | */ |
350 | - $this->registerPattern('/(['.$chars.'])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback); |
|
350 | + $this->registerPattern('/([' . $chars . '])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | protected function openFileForWriting($path) |
398 | 398 | { |
399 | 399 | if (($handler = @fopen($path, 'w')) === false) { |
400 | - throw new IOException('The file "'.$path.'" could not be opened for writing. Check if PHP has enough permissions.'); |
|
400 | + throw new IOException('The file "' . $path . '" could not be opened for writing. Check if PHP has enough permissions.'); |
|
401 | 401 | } |
402 | 402 | |
403 | 403 | return $handler; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | protected function writeToFile($handler, $content, $path = '') |
416 | 416 | { |
417 | 417 | if (($result = @fwrite($handler, $content)) === false || ($result < strlen($content))) { |
418 | - throw new IOException('The file "'.$path.'" could not be written to. Check your disk space and file permissions.'); |
|
418 | + throw new IOException('The file "' . $path . '" could not be written to. Check your disk space and file permissions.'); |
|
419 | 419 | } |
420 | 420 | } |
421 | 421 | } |
@@ -303,7 +303,7 @@ |
||
303 | 303 | ), |
304 | 304 | array( |
305 | 305 | $_POST['msg'], $message['id_topic'], $message['id_board'], $message['id_poster'], $message['real_name'], |
306 | - $message['subject'], $message['body'] , time(), time(), 1, 0, |
|
306 | + $message['subject'], $message['body'], time(), time(), 1, 0, |
|
307 | 307 | ), |
308 | 308 | array('id_report') |
309 | 309 | ); |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | |
660 | 660 | // Remove the phrase parts and extract the words. |
661 | 661 | $wordArray = preg_replace('~(?:^|\s)(?:[-]?)"(?:[^"]+)"(?:$|\s)~' . ($context['utf8'] ? 'u' : ''), ' ', $search_params['search']); |
662 | - $wordArray = explode(' ', $smcFunc['htmlspecialchars'](un_htmlspecialchars($wordArray), ENT_QUOTES)); |
|
662 | + $wordArray = explode(' ', $smcFunc['htmlspecialchars'](un_htmlspecialchars($wordArray), ENT_QUOTES)); |
|
663 | 663 | |
664 | 664 | // A minus sign in front of a word excludes the word.... so... |
665 | 665 | $excludedWords = array(); |
@@ -1104,7 +1104,7 @@ discard block |
||
1104 | 1104 | SELECT |
1105 | 1105 | {int:id_search}, |
1106 | 1106 | t.id_topic, |
1107 | - ' . $relevance. ', |
|
1107 | + ' . $relevance . ', |
|
1108 | 1108 | ' . (empty($userQuery) ? 't.id_first_msg' : 'm.id_msg') . ', |
1109 | 1109 | 1 |
1110 | 1110 | FROM ' . $subject_query['from'] . (empty($subject_query['inner_join']) ? '' : ' |
@@ -1339,7 +1339,7 @@ discard block |
||
1339 | 1339 | if (empty($subject_query['where'])) |
1340 | 1340 | continue; |
1341 | 1341 | |
1342 | - $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ( ' |
|
1342 | + $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? (' |
|
1343 | 1343 | INSERT IGNORE INTO {db_prefix}' . ($createTemporary ? 'tmp_' : '') . 'log_search_topics |
1344 | 1344 | (' . ($createTemporary ? '' : 'id_search, ') . 'id_topic)') : '') . ' |
1345 | 1345 | SELECT ' . ($createTemporary ? '' : $_SESSION['search_cache']['id_search'] . ', ') . 't.id_topic |
@@ -1568,7 +1568,7 @@ discard block |
||
1568 | 1568 | } |
1569 | 1569 | $main_query['select']['relevance'] = substr($relevance, 0, -3) . ') / ' . $new_weight_total . ' AS relevance'; |
1570 | 1570 | |
1571 | - $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ( ' |
|
1571 | + $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? (' |
|
1572 | 1572 | INSERT IGNORE INTO ' . '{db_prefix}log_search_results |
1573 | 1573 | (' . implode(', ', array_keys($main_query['select'])) . ')') : '') . ' |
1574 | 1574 | SELECT |
@@ -1636,7 +1636,7 @@ discard block |
||
1636 | 1636 | $relevance = substr($relevance, 0, -3) . ') / ' . $weight_total . ' AS relevance'; |
1637 | 1637 | |
1638 | 1638 | $usedIDs = array_flip(empty($inserts) ? array() : array_keys($inserts)); |
1639 | - $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? ( ' |
|
1639 | + $ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? (' |
|
1640 | 1640 | INSERT IGNORE INTO {db_prefix}log_search_results |
1641 | 1641 | (id_search, id_topic, relevance, id_msg, num_matches)') : '') . ' |
1642 | 1642 | SELECT |
@@ -2102,7 +2102,7 @@ discard block |
||
2102 | 2102 | $query = trim($query, "\*+"); |
2103 | 2103 | $query = strtr($smcFunc['htmlspecialchars']($query), array('\\\'' => '\'')); |
2104 | 2104 | |
2105 | - $body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => ''')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function ($m) |
|
2105 | + $body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => ''')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function($m) |
|
2106 | 2106 | { |
2107 | 2107 | return isset($m[2]) && "$m[2]" == "$m[1]" ? stripslashes("$m[1]") : "<strong class=\"highlight\">$m[1]</strong>"; |
2108 | 2108 | }, $body_highlighted); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | 'value' => $txt['admin_edit_news'], |
153 | 153 | ), |
154 | 154 | 'data' => array( |
155 | - 'function' => function ($news) |
|
155 | + 'function' => function($news) |
|
156 | 156 | { |
157 | 157 | if (is_numeric($news['id'])) |
158 | 158 | return '<textarea id="data_' . $news['id'] . '" rows="3" cols="50" name="news[]" class="padding block">' . $news['unparsed'] . '</textarea> |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | 'value' => $txt['preview'], |
169 | 169 | ), |
170 | 170 | 'data' => array( |
171 | - 'function' => function ($news) |
|
171 | + 'function' => function($news) |
|
172 | 172 | { |
173 | 173 | return '<div id="box_preview_' . $news['id'] . '" style="overflow: auto; width: 100%; height: 10ex;">' . $news['parsed'] . '</div>'; |
174 | 174 | }, |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | 'class' => 'centercol', |
182 | 182 | ), |
183 | 183 | 'data' => array( |
184 | - 'function' => function ($news) |
|
184 | + 'function' => function($news) |
|
185 | 185 | { |
186 | 186 | if (is_numeric($news['id'])) |
187 | 187 | return '<input type="checkbox" name="remove[]" value="' . $news['id'] . '" class="input_check">'; |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | * Prepare subject and message of an email for the preview box |
432 | 432 | * Used in ComposeMailing and RetrievePreview (Xml.php) |
433 | 433 | */ |
434 | -function prepareMailingForPreview () |
|
434 | +function prepareMailingForPreview() |
|
435 | 435 | { |
436 | 436 | global $context, $modSettings, $scripturl, $user_info, $txt; |
437 | 437 | loadLanguage('Errors'); |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | $request = $smcFunc['db_query']('', ' |
636 | 636 | SELECT id_member |
637 | 637 | FROM {db_prefix}members |
638 | - WHERE email_address IN(' . implode(', ', $condition_array) .')', |
|
638 | + WHERE email_address IN(' . implode(', ', $condition_array) . ')', |
|
639 | 639 | $condition_array_params |
640 | 640 | ); |
641 | 641 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
@@ -99,19 +99,19 @@ |
||
99 | 99 | { |
100 | 100 | if (isset($_COOKIE[$cookiename]) && preg_match('~^a:[34]:\{i:0;i:\d{1,7};i:1;s:(0|128):"([a-fA-F0-9]{128})?";i:2;[id]:\d{1,14};(i:3;i:\d;)?\}$~', $_COOKIE[$cookiename]) === 1) |
101 | 101 | { |
102 | - list (, , $timeout) = smf_json_decode($_COOKIE[$cookiename], true); |
|
102 | + list (,, $timeout) = smf_json_decode($_COOKIE[$cookiename], true); |
|
103 | 103 | |
104 | 104 | // That didn't work... Maybe it's using serialize? |
105 | 105 | if (is_null($timeout)) |
106 | - list (, , $timeout) = safe_unserialize($_COOKIE[$cookiename]); |
|
106 | + list (,, $timeout) = safe_unserialize($_COOKIE[$cookiename]); |
|
107 | 107 | } |
108 | 108 | elseif (isset($_SESSION['login_' . $cookiename])) |
109 | 109 | { |
110 | - list (, , $timeout) = smf_json_decode($_SESSION['login_' . $cookiename]); |
|
110 | + list (,, $timeout) = smf_json_decode($_SESSION['login_' . $cookiename]); |
|
111 | 111 | |
112 | 112 | // Try for old format |
113 | 113 | if (is_null($timeout)) |
114 | - list (, , $timeout) = safe_unserialize($_SESSION['login_' . $cookiename]); |
|
114 | + list (,, $timeout) = safe_unserialize($_SESSION['login_' . $cookiename]); |
|
115 | 115 | } |
116 | 116 | else |
117 | 117 | trigger_error('Login2(): Cannot be logged in without a session or cookie', E_USER_ERROR); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | ) |
232 | 232 | ); |
233 | 233 | |
234 | - $request = $smcFunc['db_query']('',' |
|
234 | + $request = $smcFunc['db_query']('', ' |
|
235 | 235 | SHOW default_text_search_config', |
236 | 236 | array() |
237 | 237 | ); |
@@ -428,8 +428,8 @@ discard block |
||
428 | 428 | WHERE t.schemaname= {string:schema} and ( |
429 | 429 | indexname = {string:messages_ftx} OR indexname = {string:log_search_words} )', |
430 | 430 | array( |
431 | - 'messages_ftx' => $db_prefix. 'messages_ftx', |
|
432 | - 'log_search_words' => $db_prefix. 'log_search_words', |
|
431 | + 'messages_ftx' => $db_prefix . 'messages_ftx', |
|
432 | + 'log_search_words' => $db_prefix . 'log_search_words', |
|
433 | 433 | 'schema' => 'public', |
434 | 434 | ) |
435 | 435 | ); |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $context['table_info']['index_length'] = (int) $row['index_size']; |
445 | 445 | $context['table_info']['fulltext_length'] = (int) $row['index_size']; |
446 | 446 | } |
447 | - elseif ($row['indexname'] == $db_prefix. 'log_search_words') |
|
447 | + elseif ($row['indexname'] == $db_prefix . 'log_search_words') |
|
448 | 448 | { |
449 | 449 | $context['table_info']['index_length'] = (int) $row['index_size']; |
450 | 450 | $context['table_info']['custom_index_length'] = (int) $row['index_size']; |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | // We need this for db_get_version |
802 | 802 | db_extend(); |
803 | 803 | |
804 | - if ($smcFunc['db_title'] == 'PostgreSQL'){ |
|
804 | + if ($smcFunc['db_title'] == 'PostgreSQL') { |
|
805 | 805 | $request = $smcFunc['db_query']('', ' |
806 | 806 | SELECT |
807 | 807 | indexname |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | WHERE t.schemaname= {string:schema} and indexname = {string:messages_ftx}', |
817 | 817 | array( |
818 | 818 | 'schema' => 'public', |
819 | - 'messages_ftx' => $db_prefix.'messages_ftx', |
|
819 | + 'messages_ftx' => $db_prefix . 'messages_ftx', |
|
820 | 820 | ) |
821 | 821 | ); |
822 | 822 | while ($row = $smcFunc['db_fetch_assoc']($request)) |