@@ -1097,7 +1097,7 @@ discard block |
||
1097 | 1097 | 'height' => array('optional' => true, 'match' => '(\d+)'), |
1098 | 1098 | ), |
1099 | 1099 | 'content' => '$1', |
1100 | - 'validate' => function (&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt) |
|
1100 | + 'validate' => function(&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt) |
|
1101 | 1101 | { |
1102 | 1102 | $returnContext = ''; |
1103 | 1103 | |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | } |
1133 | 1133 | |
1134 | 1134 | if ($currentAttachment['thumbnail']['has_thumb'] && empty($params['{width}']) && empty($params['{height}'])) |
1135 | - $returnContext .= '<a href="'. $currentAttachment['href']. ';image" id="link_'. $currentAttachment['id']. '" onclick="'. $currentAttachment['thumbnail']['javascript']. '"><img src="'. $currentAttachment['thumbnail']['href']. '"' . $alt . $title . ' id="thumb_'. $currentAttachment['id']. '" class="atc_img"></a>'; |
|
1135 | + $returnContext .= '<a href="' . $currentAttachment['href'] . ';image" id="link_' . $currentAttachment['id'] . '" onclick="' . $currentAttachment['thumbnail']['javascript'] . '"><img src="' . $currentAttachment['thumbnail']['href'] . '"' . $alt . $title . ' id="thumb_' . $currentAttachment['id'] . '" class="atc_img"></a>'; |
|
1136 | 1136 | else |
1137 | 1137 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img"/>'; |
1138 | 1138 | } |
@@ -1161,7 +1161,7 @@ discard block |
||
1161 | 1161 | 'type' => 'unparsed_content', |
1162 | 1162 | 'content' => '<div class="codeheader"><span class="code floatleft">' . $txt['code'] . '</span> <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>', |
1163 | 1163 | // @todo Maybe this can be simplified? |
1164 | - 'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context) |
|
1164 | + 'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context) |
|
1165 | 1165 | { |
1166 | 1166 | if (!isset($disabled['code'])) |
1167 | 1167 | { |
@@ -1198,7 +1198,7 @@ discard block |
||
1198 | 1198 | 'type' => 'unparsed_equals_content', |
1199 | 1199 | 'content' => '<div class="codeheader"><span class="code floatleft">' . $txt['code'] . '</span> ($2) <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>', |
1200 | 1200 | // @todo Maybe this can be simplified? |
1201 | - 'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context) |
|
1201 | + 'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context) |
|
1202 | 1202 | { |
1203 | 1203 | if (!isset($disabled['code'])) |
1204 | 1204 | { |
@@ -1242,7 +1242,7 @@ discard block |
||
1242 | 1242 | 'type' => 'unparsed_content', |
1243 | 1243 | 'content' => '<a href="mailto:$1" class="bbc_email">$1</a>', |
1244 | 1244 | // @todo Should this respect guest_hideContacts? |
1245 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1245 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1246 | 1246 | { |
1247 | 1247 | $data = strtr($data, array('<br>' => '')); |
1248 | 1248 | }, |
@@ -1261,7 +1261,7 @@ discard block |
||
1261 | 1261 | 'type' => 'unparsed_commas_content', |
1262 | 1262 | 'test' => '\d+,\d+\]', |
1263 | 1263 | 'content' => '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never">', |
1264 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1264 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1265 | 1265 | { |
1266 | 1266 | if (isset($disabled['url'])) |
1267 | 1267 | $tag['content'] = '$1'; |
@@ -1277,7 +1277,7 @@ discard block |
||
1277 | 1277 | 'test' => '(left|right)(\s+max=\d+(?:%|px|em|rem|ex|pt|pc|ch|vw|vh|vmin|vmax|cm|mm|in)?)?\]', |
1278 | 1278 | 'before' => '<div $1>', |
1279 | 1279 | 'after' => '</div>', |
1280 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1280 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1281 | 1281 | { |
1282 | 1282 | $class = 'class="bbc_float float' . (strpos($data, 'left') === 0 ? 'left' : 'right') . '"'; |
1283 | 1283 | |
@@ -1326,7 +1326,7 @@ discard block |
||
1326 | 1326 | 'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'), |
1327 | 1327 | ), |
1328 | 1328 | 'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">', |
1329 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1329 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1330 | 1330 | { |
1331 | 1331 | global $image_proxy_enabled, $image_proxy_secret, $boardurl; |
1332 | 1332 | |
@@ -1349,7 +1349,7 @@ discard block |
||
1349 | 1349 | 'tag' => 'img', |
1350 | 1350 | 'type' => 'unparsed_content', |
1351 | 1351 | 'content' => '<img src="$1" alt="" class="bbc_img">', |
1352 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1352 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1353 | 1353 | { |
1354 | 1354 | global $image_proxy_enabled, $image_proxy_secret, $boardurl; |
1355 | 1355 | |
@@ -1372,7 +1372,7 @@ discard block |
||
1372 | 1372 | 'tag' => 'iurl', |
1373 | 1373 | 'type' => 'unparsed_content', |
1374 | 1374 | 'content' => '<a href="$1" class="bbc_link">$1</a>', |
1375 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1375 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1376 | 1376 | { |
1377 | 1377 | $data = strtr($data, array('<br>' => '')); |
1378 | 1378 | $scheme = parse_url($data, PHP_URL_SCHEME); |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | 'quoted' => 'optional', |
1387 | 1387 | 'before' => '<a href="$1" class="bbc_link">', |
1388 | 1388 | 'after' => '</a>', |
1389 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1389 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1390 | 1390 | { |
1391 | 1391 | if (substr($data, 0, 1) == '#') |
1392 | 1392 | $data = '#post_' . substr($data, 1); |
@@ -1466,7 +1466,7 @@ discard block |
||
1466 | 1466 | 'tag' => 'php', |
1467 | 1467 | 'type' => 'unparsed_content', |
1468 | 1468 | 'content' => '<span class="phpcode">$1</span>', |
1469 | - 'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled) |
|
1469 | + 'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled) |
|
1470 | 1470 | { |
1471 | 1471 | if (!isset($disabled['php'])) |
1472 | 1472 | { |
@@ -1564,7 +1564,7 @@ discard block |
||
1564 | 1564 | 'test' => '[1-7]\]', |
1565 | 1565 | 'before' => '<span style="font-size: $1;" class="bbc_size">', |
1566 | 1566 | 'after' => '</span>', |
1567 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1567 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1568 | 1568 | { |
1569 | 1569 | $sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95); |
1570 | 1570 | $data = $sizes[$data] . 'em'; |
@@ -1602,7 +1602,7 @@ discard block |
||
1602 | 1602 | 'tag' => 'time', |
1603 | 1603 | 'type' => 'unparsed_content', |
1604 | 1604 | 'content' => '$1', |
1605 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1605 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1606 | 1606 | { |
1607 | 1607 | if (is_numeric($data)) |
1608 | 1608 | $data = timeformat($data); |
@@ -1630,7 +1630,7 @@ discard block |
||
1630 | 1630 | 'tag' => 'url', |
1631 | 1631 | 'type' => 'unparsed_content', |
1632 | 1632 | 'content' => '<a href="$1" class="bbc_link" target="_blank">$1</a>', |
1633 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1633 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1634 | 1634 | { |
1635 | 1635 | $data = strtr($data, array('<br>' => '')); |
1636 | 1636 | $scheme = parse_url($data, PHP_URL_SCHEME); |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | 'quoted' => 'optional', |
1645 | 1645 | 'before' => '<a href="$1" class="bbc_link" target="_blank">', |
1646 | 1646 | 'after' => '</a>', |
1647 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1647 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1648 | 1648 | { |
1649 | 1649 | $scheme = parse_url($data, PHP_URL_SCHEME); |
1650 | 1650 | if (empty($scheme)) |
@@ -1670,7 +1670,7 @@ discard block |
||
1670 | 1670 | { |
1671 | 1671 | if (isset($temp_bbc)) |
1672 | 1672 | $bbc_codes = $temp_bbc; |
1673 | - usort($codes, function ($a, $b) { |
|
1673 | + usort($codes, function($a, $b) { |
|
1674 | 1674 | return strcmp($a['tag'], $b['tag']); |
1675 | 1675 | }); |
1676 | 1676 | return $codes; |
@@ -1908,7 +1908,7 @@ discard block |
||
1908 | 1908 | # a run of Unicode domain name characters and a dot |
1909 | 1909 | [\p{L}\p{M}\p{N}\-.:@]+\. |
1910 | 1910 | # and then a TLD valid in the DNS or the reserved "local" TLD |
1911 | - (?:'. $modSettings['tld_regex'] .'|local) |
|
1911 | + (?:'. $modSettings['tld_regex'] . '|local) |
|
1912 | 1912 | ) |
1913 | 1913 | # followed by a non-domain character or end of line |
1914 | 1914 | (?=[^\p{L}\p{N}\-.]|$) |
@@ -1976,7 +1976,7 @@ discard block |
||
1976 | 1976 | )? |
1977 | 1977 | '; |
1978 | 1978 | |
1979 | - $data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) { |
|
1979 | + $data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) { |
|
1980 | 1980 | $url = array_shift($matches); |
1981 | 1981 | |
1982 | 1982 | $scheme = parse_url($url, PHP_URL_SCHEME); |
@@ -2705,7 +2705,7 @@ discard block |
||
2705 | 2705 | for ($i = 0, $n = count($smileysfrom); $i < $n; $i++) |
2706 | 2706 | { |
2707 | 2707 | $specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES); |
2708 | - $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')). '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
2708 | + $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
2709 | 2709 | |
2710 | 2710 | $smileyPregReplacements[$smileysfrom[$i]] = $smileyCode; |
2711 | 2711 | |
@@ -2722,7 +2722,7 @@ discard block |
||
2722 | 2722 | |
2723 | 2723 | // Replace away! |
2724 | 2724 | $message = preg_replace_callback($smileyPregSearch, |
2725 | - function ($matches) use ($smileyPregReplacements) |
|
2725 | + function($matches) use ($smileyPregReplacements) |
|
2726 | 2726 | { |
2727 | 2727 | return $smileyPregReplacements[$matches[1]]; |
2728 | 2728 | }, $message); |
@@ -2788,13 +2788,13 @@ discard block |
||
2788 | 2788 | { |
2789 | 2789 | if (defined('SID') && SID != '') |
2790 | 2790 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&))((?:board|topic)=[^#]+?)(#[^"]*?)?$~', |
2791 | - function ($m) use ($scripturl) |
|
2791 | + function($m) use ($scripturl) |
|
2792 | 2792 | { |
2793 | - return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : ""); |
|
2793 | + return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : ""); |
|
2794 | 2794 | }, $setLocation); |
2795 | 2795 | else |
2796 | 2796 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~', |
2797 | - function ($m) use ($scripturl) |
|
2797 | + function($m) use ($scripturl) |
|
2798 | 2798 | { |
2799 | 2799 | return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : ""); |
2800 | 2800 | }, $setLocation); |
@@ -3117,7 +3117,7 @@ discard block |
||
3117 | 3117 | |
3118 | 3118 | // Add a generic "Are you sure?" confirmation message. |
3119 | 3119 | addInlineJavaScript(' |
3120 | - var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';'); |
|
3120 | + var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';'); |
|
3121 | 3121 | |
3122 | 3122 | // Now add the capping code for avatars. |
3123 | 3123 | if (!empty($modSettings['avatar_max_width_external']) && !empty($modSettings['avatar_max_height_external']) && !empty($modSettings['avatar_action_too_large']) && $modSettings['avatar_action_too_large'] == 'option_css_resize') |
@@ -3478,7 +3478,7 @@ discard block |
||
3478 | 3478 | |
3479 | 3479 | else |
3480 | 3480 | echo ' |
3481 | - <script src="', $settings['theme_url'] ,'/scripts/minified', ($do_deferred ? '_deferred' : '') ,'.js', $minSeed ,'"></script>'; |
|
3481 | + <script src="', $settings['theme_url'], '/scripts/minified', ($do_deferred ? '_deferred' : ''), '.js', $minSeed, '"></script>'; |
|
3482 | 3482 | } |
3483 | 3483 | |
3484 | 3484 | // Inline JavaScript - Actually useful some times! |
@@ -3556,14 +3556,14 @@ discard block |
||
3556 | 3556 | |
3557 | 3557 | else |
3558 | 3558 | echo ' |
3559 | - <link rel="stylesheet" href="', $settings['theme_url'] ,'/css/minified.css', $minSeed ,'">'; |
|
3559 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/minified.css', $minSeed, '">'; |
|
3560 | 3560 | } |
3561 | 3561 | |
3562 | 3562 | // Print the rest after the minified files. |
3563 | 3563 | if (!empty($normal)) |
3564 | 3564 | foreach ($normal as $nf) |
3565 | 3565 | echo ' |
3566 | - <link rel="stylesheet" href="', $nf ,'">'; |
|
3566 | + <link rel="stylesheet" href="', $nf, '">'; |
|
3567 | 3567 | |
3568 | 3568 | if ($db_show_debug === true) |
3569 | 3569 | { |
@@ -3579,7 +3579,7 @@ discard block |
||
3579 | 3579 | <style>'; |
3580 | 3580 | |
3581 | 3581 | foreach ($context['css_header'] as $css) |
3582 | - echo $css .' |
|
3582 | + echo $css . ' |
|
3583 | 3583 | '; |
3584 | 3584 | |
3585 | 3585 | echo' |
@@ -3608,27 +3608,27 @@ discard block |
||
3608 | 3608 | return false; |
3609 | 3609 | |
3610 | 3610 | // Did we already did this? |
3611 | - $toCache = cache_get_data('minimized_'. $settings['theme_id'] .'_'. $type, 86400); |
|
3611 | + $toCache = cache_get_data('minimized_' . $settings['theme_id'] . '_' . $type, 86400); |
|
3612 | 3612 | |
3613 | 3613 | // Already done? |
3614 | 3614 | if (!empty($toCache)) |
3615 | 3615 | return true; |
3616 | 3616 | |
3617 | 3617 | // No namespaces, sorry! |
3618 | - $classType = 'MatthiasMullie\\Minify\\'. strtoupper($type); |
|
3618 | + $classType = 'MatthiasMullie\\Minify\\' . strtoupper($type); |
|
3619 | 3619 | |
3620 | 3620 | // Temp path. |
3621 | - $cTempPath = $settings['theme_dir'] .'/'. ($type == 'css' ? 'css' : 'scripts') .'/'; |
|
3621 | + $cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/'; |
|
3622 | 3622 | |
3623 | 3623 | // What kind of file are we going to create? |
3624 | - $toCreate = $cTempPath .'minified'. ($do_deferred ? '_deferred' : '') .'.'. $type; |
|
3624 | + $toCreate = $cTempPath . 'minified' . ($do_deferred ? '_deferred' : '') . '.' . $type; |
|
3625 | 3625 | |
3626 | 3626 | // File has to exists, if it isn't try to create it. |
3627 | 3627 | if ((!file_exists($toCreate) && @fopen($toCreate, 'w') === false) || !smf_chmod($toCreate)) |
3628 | 3628 | { |
3629 | 3629 | loadLanguage('Errors'); |
3630 | 3630 | log_error(sprintf($txt['file_not_created'], $toCreate), 'general'); |
3631 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null); |
|
3631 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null); |
|
3632 | 3632 | |
3633 | 3633 | // The process failed so roll back to print each individual file. |
3634 | 3634 | return $data; |
@@ -3663,14 +3663,14 @@ discard block |
||
3663 | 3663 | { |
3664 | 3664 | loadLanguage('Errors'); |
3665 | 3665 | log_error(sprintf($txt['file_not_created'], $toCreate), 'general'); |
3666 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null); |
|
3666 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null); |
|
3667 | 3667 | |
3668 | 3668 | // The process failed so roll back to print each individual file. |
3669 | 3669 | return $data; |
3670 | 3670 | } |
3671 | 3671 | |
3672 | 3672 | // And create a long lived cache entry. |
3673 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, $toCreate, 86400); |
|
3673 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, $toCreate, 86400); |
|
3674 | 3674 | |
3675 | 3675 | return true; |
3676 | 3676 | } |
@@ -3730,7 +3730,7 @@ discard block |
||
3730 | 3730 | else |
3731 | 3731 | $path = $modSettings['attachmentUploadDir']; |
3732 | 3732 | |
3733 | - return $path . '/' . $attachment_id . '_' . $file_hash .'.dat'; |
|
3733 | + return $path . '/' . $attachment_id . '_' . $file_hash . '.dat'; |
|
3734 | 3734 | } |
3735 | 3735 | |
3736 | 3736 | /** |
@@ -3774,10 +3774,10 @@ discard block |
||
3774 | 3774 | $valid_low = isValidIP($ip_parts[0]); |
3775 | 3775 | $valid_high = isValidIP($ip_parts[1]); |
3776 | 3776 | $count = 0; |
3777 | - $mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.'); |
|
3777 | + $mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.'); |
|
3778 | 3778 | $max = ($mode == ':' ? 'ffff' : '255'); |
3779 | 3779 | $min = 0; |
3780 | - if(!$valid_low) |
|
3780 | + if (!$valid_low) |
|
3781 | 3781 | { |
3782 | 3782 | $ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]); |
3783 | 3783 | $valid_low = isValidIP($ip_parts[0]); |
@@ -3791,7 +3791,7 @@ discard block |
||
3791 | 3791 | } |
3792 | 3792 | |
3793 | 3793 | $count = 0; |
3794 | - if(!$valid_high) |
|
3794 | + if (!$valid_high) |
|
3795 | 3795 | { |
3796 | 3796 | $ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]); |
3797 | 3797 | $valid_high = isValidIP($ip_parts[1]); |
@@ -3804,7 +3804,7 @@ discard block |
||
3804 | 3804 | } |
3805 | 3805 | } |
3806 | 3806 | |
3807 | - if($valid_high && $valid_low) |
|
3807 | + if ($valid_high && $valid_low) |
|
3808 | 3808 | { |
3809 | 3809 | $ip_array['low'] = $ip_parts[0]; |
3810 | 3810 | $ip_array['high'] = $ip_parts[1]; |
@@ -3986,7 +3986,7 @@ discard block |
||
3986 | 3986 | addInlineJavaScript(' |
3987 | 3987 | var user_menus = new smc_PopupMenu(); |
3988 | 3988 | user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup"); |
3989 | - user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true); |
|
3989 | + user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true); |
|
3990 | 3990 | if ($context['allow_pm']) |
3991 | 3991 | addInlineJavaScript(' |
3992 | 3992 | user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true); |
@@ -4611,7 +4611,7 @@ discard block |
||
4611 | 4611 | // No? try a fallback to $sourcedir |
4612 | 4612 | else |
4613 | 4613 | { |
4614 | - $absPath = $sourcedir .'/'. $file; |
|
4614 | + $absPath = $sourcedir . '/' . $file; |
|
4615 | 4615 | |
4616 | 4616 | if (file_exists($absPath)) |
4617 | 4617 | require_once($absPath); |
@@ -4692,15 +4692,15 @@ discard block |
||
4692 | 4692 | |
4693 | 4693 | // UTF-8 occurences of MS special characters |
4694 | 4694 | $findchars_utf8 = array( |
4695 | - "\xe2\80\x9a", // single low-9 quotation mark |
|
4696 | - "\xe2\80\x9e", // double low-9 quotation mark |
|
4697 | - "\xe2\80\xa6", // horizontal ellipsis |
|
4698 | - "\xe2\x80\x98", // left single curly quote |
|
4699 | - "\xe2\x80\x99", // right single curly quote |
|
4700 | - "\xe2\x80\x9c", // left double curly quote |
|
4701 | - "\xe2\x80\x9d", // right double curly quote |
|
4702 | - "\xe2\x80\x93", // en dash |
|
4703 | - "\xe2\x80\x94", // em dash |
|
4695 | + "\xe2\80\x9a", // single low-9 quotation mark |
|
4696 | + "\xe2\80\x9e", // double low-9 quotation mark |
|
4697 | + "\xe2\80\xa6", // horizontal ellipsis |
|
4698 | + "\xe2\x80\x98", // left single curly quote |
|
4699 | + "\xe2\x80\x99", // right single curly quote |
|
4700 | + "\xe2\x80\x9c", // left double curly quote |
|
4701 | + "\xe2\x80\x9d", // right double curly quote |
|
4702 | + "\xe2\x80\x93", // en dash |
|
4703 | + "\xe2\x80\x94", // em dash |
|
4704 | 4704 | ); |
4705 | 4705 | |
4706 | 4706 | // windows 1252 / iso equivalents |
@@ -4718,15 +4718,15 @@ discard block |
||
4718 | 4718 | |
4719 | 4719 | // safe replacements |
4720 | 4720 | $replacechars = array( |
4721 | - ',', // ‚ |
|
4722 | - ',,', // „ |
|
4723 | - '...', // … |
|
4724 | - "'", // ‘ |
|
4725 | - "'", // ’ |
|
4726 | - '"', // “ |
|
4727 | - '"', // ” |
|
4728 | - '-', // – |
|
4729 | - '--', // — |
|
4721 | + ',', // ‚ |
|
4722 | + ',,', // „ |
|
4723 | + '...', // … |
|
4724 | + "'", // ‘ |
|
4725 | + "'", // ’ |
|
4726 | + '"', // “ |
|
4727 | + '"', // ” |
|
4728 | + '-', // – |
|
4729 | + '--', // — |
|
4730 | 4730 | ); |
4731 | 4731 | |
4732 | 4732 | if ($context['utf8']) |
@@ -5089,7 +5089,7 @@ discard block |
||
5089 | 5089 | */ |
5090 | 5090 | function inet_dtop($bin) |
5091 | 5091 | { |
5092 | - if(empty($bin)) |
|
5092 | + if (empty($bin)) |
|
5093 | 5093 | return ''; |
5094 | 5094 | |
5095 | 5095 | global $db_type; |
@@ -5120,28 +5120,28 @@ discard block |
||
5120 | 5120 | */ |
5121 | 5121 | function _safe_serialize($value) |
5122 | 5122 | { |
5123 | - if(is_null($value)) |
|
5123 | + if (is_null($value)) |
|
5124 | 5124 | return 'N;'; |
5125 | 5125 | |
5126 | - if(is_bool($value)) |
|
5127 | - return 'b:'. (int) $value .';'; |
|
5126 | + if (is_bool($value)) |
|
5127 | + return 'b:' . (int) $value . ';'; |
|
5128 | 5128 | |
5129 | - if(is_int($value)) |
|
5130 | - return 'i:'. $value .';'; |
|
5129 | + if (is_int($value)) |
|
5130 | + return 'i:' . $value . ';'; |
|
5131 | 5131 | |
5132 | - if(is_float($value)) |
|
5133 | - return 'd:'. str_replace(',', '.', $value) .';'; |
|
5132 | + if (is_float($value)) |
|
5133 | + return 'd:' . str_replace(',', '.', $value) . ';'; |
|
5134 | 5134 | |
5135 | - if(is_string($value)) |
|
5136 | - return 's:'. strlen($value) .':"'. $value .'";'; |
|
5135 | + if (is_string($value)) |
|
5136 | + return 's:' . strlen($value) . ':"' . $value . '";'; |
|
5137 | 5137 | |
5138 | - if(is_array($value)) |
|
5138 | + if (is_array($value)) |
|
5139 | 5139 | { |
5140 | 5140 | $out = ''; |
5141 | - foreach($value as $k => $v) |
|
5141 | + foreach ($value as $k => $v) |
|
5142 | 5142 | $out .= _safe_serialize($k) . _safe_serialize($v); |
5143 | 5143 | |
5144 | - return 'a:'. count($value) .':{'. $out .'}'; |
|
5144 | + return 'a:' . count($value) . ':{' . $out . '}'; |
|
5145 | 5145 | } |
5146 | 5146 | |
5147 | 5147 | // safe_serialize cannot serialize resources or objects. |
@@ -5183,7 +5183,7 @@ discard block |
||
5183 | 5183 | function _safe_unserialize($str) |
5184 | 5184 | { |
5185 | 5185 | // Input is not a string. |
5186 | - if(empty($str) || !is_string($str)) |
|
5186 | + if (empty($str) || !is_string($str)) |
|
5187 | 5187 | return false; |
5188 | 5188 | |
5189 | 5189 | $stack = array(); |
@@ -5197,40 +5197,40 @@ discard block |
||
5197 | 5197 | * 3 - in array, expecting value or another array |
5198 | 5198 | */ |
5199 | 5199 | $state = 0; |
5200 | - while($state != 1) |
|
5200 | + while ($state != 1) |
|
5201 | 5201 | { |
5202 | 5202 | $type = isset($str[0]) ? $str[0] : ''; |
5203 | - if($type == '}') |
|
5203 | + if ($type == '}') |
|
5204 | 5204 | $str = substr($str, 1); |
5205 | 5205 | |
5206 | - else if($type == 'N' && $str[1] == ';') |
|
5206 | + else if ($type == 'N' && $str[1] == ';') |
|
5207 | 5207 | { |
5208 | 5208 | $value = null; |
5209 | 5209 | $str = substr($str, 2); |
5210 | 5210 | } |
5211 | - else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
5211 | + else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
5212 | 5212 | { |
5213 | 5213 | $value = $matches[1] == '1' ? true : false; |
5214 | 5214 | $str = substr($str, 4); |
5215 | 5215 | } |
5216 | - else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
5216 | + else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
5217 | 5217 | { |
5218 | - $value = (int)$matches[1]; |
|
5218 | + $value = (int) $matches[1]; |
|
5219 | 5219 | $str = $matches[2]; |
5220 | 5220 | } |
5221 | - else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
5221 | + else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
5222 | 5222 | { |
5223 | - $value = (float)$matches[1]; |
|
5223 | + $value = (float) $matches[1]; |
|
5224 | 5224 | $str = $matches[3]; |
5225 | 5225 | } |
5226 | - else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";') |
|
5226 | + else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";') |
|
5227 | 5227 | { |
5228 | - $value = substr($matches[2], 0, (int)$matches[1]); |
|
5229 | - $str = substr($matches[2], (int)$matches[1] + 2); |
|
5228 | + $value = substr($matches[2], 0, (int) $matches[1]); |
|
5229 | + $str = substr($matches[2], (int) $matches[1] + 2); |
|
5230 | 5230 | } |
5231 | - else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
5231 | + else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
5232 | 5232 | { |
5233 | - $expectedLength = (int)$matches[1]; |
|
5233 | + $expectedLength = (int) $matches[1]; |
|
5234 | 5234 | $str = $matches[2]; |
5235 | 5235 | } |
5236 | 5236 | |
@@ -5238,10 +5238,10 @@ discard block |
||
5238 | 5238 | else |
5239 | 5239 | return false; |
5240 | 5240 | |
5241 | - switch($state) |
|
5241 | + switch ($state) |
|
5242 | 5242 | { |
5243 | 5243 | case 3: // In array, expecting value or another array. |
5244 | - if($type == 'a') |
|
5244 | + if ($type == 'a') |
|
5245 | 5245 | { |
5246 | 5246 | $stack[] = &$list; |
5247 | 5247 | $list[$key] = array(); |
@@ -5250,7 +5250,7 @@ discard block |
||
5250 | 5250 | $state = 2; |
5251 | 5251 | break; |
5252 | 5252 | } |
5253 | - if($type != '}') |
|
5253 | + if ($type != '}') |
|
5254 | 5254 | { |
5255 | 5255 | $list[$key] = $value; |
5256 | 5256 | $state = 2; |
@@ -5261,29 +5261,29 @@ discard block |
||
5261 | 5261 | return false; |
5262 | 5262 | |
5263 | 5263 | case 2: // in array, expecting end of array or a key |
5264 | - if($type == '}') |
|
5264 | + if ($type == '}') |
|
5265 | 5265 | { |
5266 | 5266 | // Array size is less than expected. |
5267 | - if(count($list) < end($expected)) |
|
5267 | + if (count($list) < end($expected)) |
|
5268 | 5268 | return false; |
5269 | 5269 | |
5270 | 5270 | unset($list); |
5271 | - $list = &$stack[count($stack)-1]; |
|
5271 | + $list = &$stack[count($stack) - 1]; |
|
5272 | 5272 | array_pop($stack); |
5273 | 5273 | |
5274 | 5274 | // Go to terminal state if we're at the end of the root array. |
5275 | 5275 | array_pop($expected); |
5276 | 5276 | |
5277 | - if(count($expected) == 0) |
|
5277 | + if (count($expected) == 0) |
|
5278 | 5278 | $state = 1; |
5279 | 5279 | |
5280 | 5280 | break; |
5281 | 5281 | } |
5282 | 5282 | |
5283 | - if($type == 'i' || $type == 's') |
|
5283 | + if ($type == 'i' || $type == 's') |
|
5284 | 5284 | { |
5285 | 5285 | // Array size exceeds expected length. |
5286 | - if(count($list) >= end($expected)) |
|
5286 | + if (count($list) >= end($expected)) |
|
5287 | 5287 | return false; |
5288 | 5288 | |
5289 | 5289 | $key = $value; |
@@ -5296,7 +5296,7 @@ discard block |
||
5296 | 5296 | |
5297 | 5297 | // Expecting array or value. |
5298 | 5298 | case 0: |
5299 | - if($type == 'a') |
|
5299 | + if ($type == 'a') |
|
5300 | 5300 | { |
5301 | 5301 | $data = array(); |
5302 | 5302 | $list = &$data; |
@@ -5305,7 +5305,7 @@ discard block |
||
5305 | 5305 | break; |
5306 | 5306 | } |
5307 | 5307 | |
5308 | - if($type != '}') |
|
5308 | + if ($type != '}') |
|
5309 | 5309 | { |
5310 | 5310 | $data = $value; |
5311 | 5311 | $state = 1; |
@@ -5318,7 +5318,7 @@ discard block |
||
5318 | 5318 | } |
5319 | 5319 | |
5320 | 5320 | // Trailing data in input. |
5321 | - if(!empty($str)) |
|
5321 | + if (!empty($str)) |
|
5322 | 5322 | return false; |
5323 | 5323 | |
5324 | 5324 | return $data; |
@@ -5372,7 +5372,7 @@ discard block |
||
5372 | 5372 | // Set different modes. |
5373 | 5373 | $chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666); |
5374 | 5374 | |
5375 | - foreach($chmodValues as $val) |
|
5375 | + foreach ($chmodValues as $val) |
|
5376 | 5376 | { |
5377 | 5377 | // If it's writable, break out of the loop. |
5378 | 5378 | if (is_writable($file)) |
@@ -5407,13 +5407,13 @@ discard block |
||
5407 | 5407 | $returnArray = @json_decode($json, $returnAsArray); |
5408 | 5408 | |
5409 | 5409 | // PHP 5.3 so no json_last_error_msg() |
5410 | - switch(json_last_error()) |
|
5410 | + switch (json_last_error()) |
|
5411 | 5411 | { |
5412 | 5412 | case JSON_ERROR_NONE: |
5413 | 5413 | $jsonError = false; |
5414 | 5414 | break; |
5415 | 5415 | case JSON_ERROR_DEPTH: |
5416 | - $jsonError = 'JSON_ERROR_DEPTH'; |
|
5416 | + $jsonError = 'JSON_ERROR_DEPTH'; |
|
5417 | 5417 | break; |
5418 | 5418 | case JSON_ERROR_STATE_MISMATCH: |
5419 | 5419 | $jsonError = 'JSON_ERROR_STATE_MISMATCH'; |
@@ -5441,10 +5441,10 @@ discard block |
||
5441 | 5441 | loadLanguage('Errors'); |
5442 | 5442 | |
5443 | 5443 | if (!empty($jsonDebug)) |
5444 | - log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
5444 | + log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
5445 | 5445 | |
5446 | 5446 | else |
5447 | - log_error($txt['json_'. $jsonError], 'critical'); |
|
5447 | + log_error($txt['json_' . $jsonError], 'critical'); |
|
5448 | 5448 | |
5449 | 5449 | // Everyone expects an array. |
5450 | 5450 | return array(); |
@@ -5548,7 +5548,7 @@ discard block |
||
5548 | 5548 | }); |
5549 | 5549 | |
5550 | 5550 | // Convert Punycode to Unicode |
5551 | - $tlds = array_map(function ($input) { |
|
5551 | + $tlds = array_map(function($input) { |
|
5552 | 5552 | $prefix = 'xn--'; |
5553 | 5553 | $safe_char = 0xFFFC; |
5554 | 5554 | $base = 36; |
@@ -5564,7 +5564,7 @@ discard block |
||
5564 | 5564 | |
5565 | 5565 | foreach ($enco_parts as $encoded) |
5566 | 5566 | { |
5567 | - if (strpos($encoded,$prefix) !== 0 || strlen(trim(str_replace($prefix,'',$encoded))) == 0) |
|
5567 | + if (strpos($encoded, $prefix) !== 0 || strlen(trim(str_replace($prefix, '', $encoded))) == 0) |
|
5568 | 5568 | { |
5569 | 5569 | $output_parts[] = $encoded; |
5570 | 5570 | continue; |
@@ -5575,7 +5575,7 @@ discard block |
||
5575 | 5575 | $idx = 0; |
5576 | 5576 | $char = 0x80; |
5577 | 5577 | $decoded = array(); |
5578 | - $output=''; |
|
5578 | + $output = ''; |
|
5579 | 5579 | $delim_pos = strrpos($encoded, '-'); |
5580 | 5580 | |
5581 | 5581 | if ($delim_pos > strlen($prefix)) |
@@ -5591,7 +5591,7 @@ discard block |
||
5591 | 5591 | |
5592 | 5592 | for ($enco_idx = $delim_pos ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) |
5593 | 5593 | { |
5594 | - for ($old_idx = $idx, $w = 1, $k = $base; 1 ; $k += $base) |
|
5594 | + for ($old_idx = $idx, $w = 1, $k = $base; 1; $k += $base) |
|
5595 | 5595 | { |
5596 | 5596 | $cp = ord($encoded{$enco_idx++}); |
5597 | 5597 | $digit = ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $base)); |
@@ -5632,15 +5632,15 @@ discard block |
||
5632 | 5632 | |
5633 | 5633 | // 2 bytes |
5634 | 5634 | elseif ($v < (1 << 11)) |
5635 | - $output .= chr(192+($v >> 6)) . chr(128+($v & 63)); |
|
5635 | + $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); |
|
5636 | 5636 | |
5637 | 5637 | // 3 bytes |
5638 | 5638 | elseif ($v < (1 << 16)) |
5639 | - $output .= chr(224+($v >> 12)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63)); |
|
5639 | + $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
5640 | 5640 | |
5641 | 5641 | // 4 bytes |
5642 | 5642 | elseif ($v < (1 << 21)) |
5643 | - $output .= chr(240+($v >> 18)) . chr(128+(($v >> 12) & 63)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63)); |
|
5643 | + $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
5644 | 5644 | |
5645 | 5645 | // 'Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k |
5646 | 5646 | else |
@@ -5747,7 +5747,7 @@ discard block |
||
5747 | 5747 | } |
5748 | 5748 | |
5749 | 5749 | // This recursive function creates the index array from the strings |
5750 | - $add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
5750 | + $add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
5751 | 5751 | { |
5752 | 5752 | static $depth = 0; |
5753 | 5753 | $depth++; |
@@ -5774,7 +5774,7 @@ discard block |
||
5774 | 5774 | }; |
5775 | 5775 | |
5776 | 5776 | // This recursive function turns the index array into a regular expression |
5777 | - $index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex) |
|
5777 | + $index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex) |
|
5778 | 5778 | { |
5779 | 5779 | static $depth = 0; |
5780 | 5780 | $depth++; |
@@ -5798,11 +5798,11 @@ discard block |
||
5798 | 5798 | |
5799 | 5799 | if (count(array_keys($value)) == 1) |
5800 | 5800 | { |
5801 | - $new_key_array = explode('(?'.'>', $sub_regex); |
|
5801 | + $new_key_array = explode('(?' . '>', $sub_regex); |
|
5802 | 5802 | $new_key .= $new_key_array[0]; |
5803 | 5803 | } |
5804 | 5804 | else |
5805 | - $sub_regex = '(?'.'>' . $sub_regex . ')'; |
|
5805 | + $sub_regex = '(?' . '>' . $sub_regex . ')'; |
|
5806 | 5806 | } |
5807 | 5807 | |
5808 | 5808 | if ($depth > 1) |
@@ -5842,7 +5842,7 @@ discard block |
||
5842 | 5842 | $index = $add_string_to_index($string, $index); |
5843 | 5843 | |
5844 | 5844 | while (!empty($index)) |
5845 | - $regexes[] = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
5845 | + $regexes[] = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
5846 | 5846 | |
5847 | 5847 | // Restore PHP's internal character encoding to whatever it was originally |
5848 | 5848 | if (!empty($current_encoding)) |