@@ -181,14 +181,14 @@ discard block |
||
181 | 181 | { |
182 | 182 | collapsedDiv.show(\'slow\'); |
183 | 183 | icon.removeClass(\'toggle_down\').addClass(\'toggle_up\'); |
184 | - icon.prop(\'title\', '. JavaScriptEscape($txt['hide']) .'); |
|
184 | + icon.prop(\'title\', '. JavaScriptEscape($txt['hide']) . '); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | else |
188 | 188 | { |
189 | 189 | collapsedDiv.hide(\'slow\'); |
190 | 190 | icon.removeClass(\'toggle_up\').addClass(\'toggle_down\'); |
191 | - icon.prop(\'title\', '. JavaScriptEscape($txt['show']) .'); |
|
191 | + icon.prop(\'title\', '. JavaScriptEscape($txt['show']) . '); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | });', true); |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | |
642 | 642 | // Setup the correct template, even though I'll admit we ain't downloading ;) |
643 | 643 | $context['sub_template'] = 'downloaded'; |
644 | - $allowext = array('.zip','.tgz','.gz'); |
|
644 | + $allowext = array('.zip', '.tgz', '.gz'); |
|
645 | 645 | // @todo Use FTP if the Packages directory is not writable. |
646 | 646 | |
647 | 647 | // Check the file was even sent! |
@@ -653,13 +653,13 @@ discard block |
||
653 | 653 | // Make sure it has a sane filename. |
654 | 654 | $_FILES['package']['name'] = preg_replace(array('/\s/', '/\.[\.]+/', '/[^\w_\.\-]/'), array('_', '.', ''), $_FILES['package']['name']); |
655 | 655 | $extension = substr(strrchr(strtolower($_FILES['package']['name']), '.'), 0); |
656 | - if(!in_array($extension, $allowext)) |
|
656 | + if (!in_array($extension, $allowext)) |
|
657 | 657 | { |
658 | 658 | fatal_lang_error('package_upload_error_supports', false, array('zip, tgz, tar.gz')); |
659 | 659 | } |
660 | 660 | |
661 | 661 | // We only need the filename... |
662 | - $extension = ($extension == '.gz') ? '.tar.gz' : $extension ; |
|
662 | + $extension = ($extension == '.gz') ? '.tar.gz' : $extension; |
|
663 | 663 | $packageName = time() . $extension; |
664 | 664 | |
665 | 665 | // Setup the destination and throw an error if the file is already there! |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $currentServers = $this->memcached->getServerList(); |
55 | 55 | foreach ($servers as $server) |
56 | 56 | { |
57 | - if (strpos($server,'/') !== false) |
|
57 | + if (strpos($server, '/') !== false) |
|
58 | 58 | $tempServer = array($server, 0); |
59 | 59 | else |
60 | 60 | { |
@@ -240,8 +240,8 @@ |
||
240 | 240 | $time_string = str_replace(array('%I', '%H', '%S', '%r', '%R', '%T'), array('%l', '%k', '', '%l:%M %p', '%k:%M', '%l:%M'), $matches[0]); |
241 | 241 | |
242 | 242 | $js_time_string = str_replace( |
243 | - array('%H', '%k', '%I', '%l', '%M', '%p', '%P', '%r', '%R', '%S', '%T', '%X'), |
|
244 | - array('H', 'G', 'h', 'g', 'i', 'A', 'a', 'h:i:s A', 'H:i', 's', 'H:i:s', 'H:i:s'), |
|
243 | + array('%H', '%k', '%I', '%l', '%M', '%p', '%P', '%r', '%R', '%S', '%T', '%X'), |
|
244 | + array('H', 'G', 'h', 'g', 'i', 'A', 'a', 'h:i:s A', 'H:i', 's', 'H:i:s', 'H:i:s'), |
|
245 | 245 | $time_string |
246 | 246 | ); |
247 | 247 |
@@ -1619,8 +1619,7 @@ |
||
1619 | 1619 | updateStats('topic'); |
1620 | 1620 | |
1621 | 1621 | // This function is needed to do the updateStats('subject') call. |
1622 | - $smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : |
|
1623 | - function($string){ |
|
1622 | + $smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : function($string) { |
|
1624 | 1623 | global $sourcedir; |
1625 | 1624 | if (function_exists('mb_strtolower')) |
1626 | 1625 | return mb_strtolower($string, 'UTF-8'); |
@@ -3031,8 +3031,7 @@ |
||
3031 | 3031 | <div class="roundframe"> |
3032 | 3032 | <div> |
3033 | 3033 | ', !empty($context['tfa_backup']) ? ' |
3034 | - <div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : |
|
3035 | - ($modSettings['tfa_mode'] == 2 ? ' |
|
3034 | + <div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : ($modSettings['tfa_mode'] == 2 ? ' |
|
3036 | 3035 | <div class="smalltext"><strong>' . $txt['tfa_forced_desc'] . '</strong></div>' : ''), ' |
3037 | 3036 | <div class="smalltext">', $txt['tfa_desc'], '</div> |
3038 | 3037 | <div id="basicinfo" style="width: 60%"> |
@@ -21,7 +21,7 @@ |
||
21 | 21 | <div id="recent" class="main_section"> |
22 | 22 | <div class="cat_bar"> |
23 | 23 | <h3 class="catbg"> |
24 | - <span class="xx"></span>',$txt['recent_posts'],' |
|
24 | + <span class="xx"></span>',$txt['recent_posts'], ' |
|
25 | 25 | </h3> |
26 | 26 | </div> |
27 | 27 | <div class="pagesection">', $context['page_index'], '</div>'; |
@@ -104,7 +104,7 @@ |
||
104 | 104 | * |
105 | 105 | * @param string $class The fully-qualified class name. |
106 | 106 | */ |
107 | -spl_autoload_register(function ($class) use ($sourcedir) |
|
107 | +spl_autoload_register(function($class) use ($sourcedir) |
|
108 | 108 | { |
109 | 109 | $classMap = array( |
110 | 110 | 'ReCaptcha\\' => 'ReCaptcha/', |
@@ -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 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | // add to top |
85 | - $content = implode('', $matches[0]).$content; |
|
85 | + $content = implode('', $matches[0]) . $content; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | return $content; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | // loop the matches |
208 | 208 | foreach ($matches as $match) { |
209 | 209 | // get the path for the file that will be imported |
210 | - $importPath = dirname($source).'/'.$match['path']; |
|
210 | + $importPath = dirname($source) . '/' . $match['path']; |
|
211 | 211 | |
212 | 212 | // only replace the import with the content if we can grab the |
213 | 213 | // content of the file |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | // check if current file was not imported previously in the same |
216 | 216 | // import chain. |
217 | 217 | if (in_array($importPath, $parents)) { |
218 | - throw new FileImportException('Failed to import file "'.$importPath.'": circular reference detected.'); |
|
218 | + throw new FileImportException('Failed to import file "' . $importPath . '": circular reference detected.'); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | // grab referenced file & minify it (which may include importing |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | |
226 | 226 | // check if this is only valid for certain media |
227 | 227 | if (!empty($match['media'])) { |
228 | - $importContent = '@media '.$match['media'].'{'.$importContent.'}'; |
|
228 | + $importContent = '@media ' . $match['media'] . '{' . $importContent . '}'; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | // add to replacement array |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | protected function importFiles($source, $content) |
255 | 255 | { |
256 | 256 | $extensions = array_keys($this->importExtensions); |
257 | - $regex = '/url\((["\']?)((?!["\']?data:).*?\.('.implode('|', $extensions).'))\\1\)/i'; |
|
257 | + $regex = '/url\((["\']?)((?!["\']?data:).*?\.(' . implode('|', $extensions) . '))\\1\)/i'; |
|
258 | 258 | if ($extensions && preg_match_all($regex, $content, $matches, PREG_SET_ORDER)) { |
259 | 259 | $search = array(); |
260 | 260 | $replace = array(); |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | foreach ($matches as $match) { |
264 | 264 | // get the path for the file that will be imported |
265 | 265 | $path = $match[2]; |
266 | - $path = dirname($source).'/'.$path; |
|
266 | + $path = dirname($source) . '/' . $path; |
|
267 | 267 | $extension = $match[3]; |
268 | 268 | |
269 | 269 | // only replace the import with the content if we're able to get |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | |
276 | 276 | // build replacement |
277 | 277 | $search[] = $match[0]; |
278 | - $replace[] = 'url('.$this->importExtensions[$extension].';base64,'.$importContent.')'; |
|
278 | + $replace[] = 'url(' . $this->importExtensions[$extension] . ';base64,' . $importContent . ')'; |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | |
@@ -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 | |
@@ -519,8 +519,8 @@ discard block |
||
519 | 519 | ); |
520 | 520 | |
521 | 521 | return preg_replace_callback( |
522 | - '/(?<=[: ])('.implode(array_keys($colors), '|').')(?=[; }])/i', |
|
523 | - function ($match) use ($colors) { |
|
522 | + '/(?<=[: ])(' . implode(array_keys($colors), '|') . ')(?=[; }])/i', |
|
523 | + function($match) use ($colors) { |
|
524 | 524 | return $colors[strtoupper($match[0])]; |
525 | 525 | }, |
526 | 526 | $content |
@@ -541,11 +541,11 @@ discard block |
||
541 | 541 | 'bold' => 700, |
542 | 542 | ); |
543 | 543 | |
544 | - $callback = function ($match) use ($weights) { |
|
545 | - return $match[1].$weights[$match[2]]; |
|
544 | + $callback = function($match) use ($weights) { |
|
545 | + return $match[1] . $weights[$match[2]]; |
|
546 | 546 | }; |
547 | 547 | |
548 | - return preg_replace_callback('/(font-weight\s*:\s*)('.implode('|', array_keys($weights)).')(?=[;}])/', $callback, $content); |
|
548 | + return preg_replace_callback('/(font-weight\s*:\s*)(' . implode('|', array_keys($weights)) . ')(?=[;}])/', $callback, $content); |
|
549 | 549 | } |
550 | 550 | |
551 | 551 | /** |
@@ -571,19 +571,19 @@ discard block |
||
571 | 571 | // practice, Webkit (especially Safari) seems to stumble over at least |
572 | 572 | // 0%, potentially other units as well. Only stripping 'px' for now. |
573 | 573 | // @see https://github.com/matthiasmullie/minify/issues/60 |
574 | - $content = preg_replace('/'.$before.'(-?0*(\.0+)?)(?<=0)px'.$after.'/', '\\1', $content); |
|
574 | + $content = preg_replace('/' . $before . '(-?0*(\.0+)?)(?<=0)px' . $after . '/', '\\1', $content); |
|
575 | 575 | |
576 | 576 | // strip 0-digits (.0 -> 0) |
577 | - $content = preg_replace('/'.$before.'\.0+'.$units.'?'.$after.'/', '0\\1', $content); |
|
577 | + $content = preg_replace('/' . $before . '\.0+' . $units . '?' . $after . '/', '0\\1', $content); |
|
578 | 578 | // strip trailing 0: 50.10 -> 50.1, 50.10px -> 50.1px |
579 | - $content = preg_replace('/'.$before.'(-?[0-9]+\.[0-9]+)0+'.$units.'?'.$after.'/', '\\1\\2', $content); |
|
579 | + $content = preg_replace('/' . $before . '(-?[0-9]+\.[0-9]+)0+' . $units . '?' . $after . '/', '\\1\\2', $content); |
|
580 | 580 | // strip trailing 0: 50.00 -> 50, 50.00px -> 50px |
581 | - $content = preg_replace('/'.$before.'(-?[0-9]+)\.0+'.$units.'?'.$after.'/', '\\1\\2', $content); |
|
581 | + $content = preg_replace('/' . $before . '(-?[0-9]+)\.0+' . $units . '?' . $after . '/', '\\1\\2', $content); |
|
582 | 582 | // strip leading 0: 0.1 -> .1, 01.1 -> 1.1 |
583 | - $content = preg_replace('/'.$before.'(-?)0+([0-9]*\.[0-9]+)'.$units.'?'.$after.'/', '\\1\\2\\3', $content); |
|
583 | + $content = preg_replace('/' . $before . '(-?)0+([0-9]*\.[0-9]+)' . $units . '?' . $after . '/', '\\1\\2\\3', $content); |
|
584 | 584 | |
585 | 585 | // strip negative zeroes (-0 -> 0) & truncate zeroes (00 -> 0) |
586 | - $content = preg_replace('/'.$before.'-?0+'.$units.'?'.$after.'/', '0\\1', $content); |
|
586 | + $content = preg_replace('/' . $before . '-?0+' . $units . '?' . $after . '/', '0\\1', $content); |
|
587 | 587 | |
588 | 588 | // remove zeroes where they make no sense in calc: e.g. calc(100px - 0) |
589 | 589 | // the 0 doesn't have any effect, and this isn't even valid without unit |