@@ -256,8 +256,8 @@ discard block |
||
256 | 256 | $time_string = str_replace(array('%I', '%H', '%S', '%r', '%R', '%T'), array('%l', '%k', '', '%l:%M %p', '%k:%M', '%l:%M'), $matches[0]); |
257 | 257 | |
258 | 258 | $js_time_string = str_replace( |
259 | - array('%H', '%k', '%I', '%l', '%M', '%p', '%P', '%r', '%R', '%S', '%T', '%X'), |
|
260 | - array('H', 'G', 'h', 'g', 'i', 'A', 'a', 'h:i:s A', 'H:i', 's', 'H:i:s', 'H:i:s'), |
|
259 | + array('%H', '%k', '%I', '%l', '%M', '%p', '%P', '%r', '%R', '%S', '%T', '%X'), |
|
260 | + array('H', 'G', 'h', 'g', 'i', 'A', 'a', 'h:i:s A', 'H:i', 's', 'H:i:s', 'H:i:s'), |
|
261 | 261 | $time_string |
262 | 262 | ); |
263 | 263 | |
@@ -1306,14 +1306,14 @@ discard block |
||
1306 | 1306 | if (isset($context['name']) && isset($context['email'])) |
1307 | 1307 | { |
1308 | 1308 | $context['posting_fields']['guestname'] = array( |
1309 | - 'dt' => '<span id="caption_guestname"' . (isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? ' class="error"' : '') . '>' . $txt['name'] . '</span>', |
|
1309 | + 'dt' => '<span id="caption_guestname"' . (isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? ' class="error"' : '') . '>' . $txt['name'] . '</span>', |
|
1310 | 1310 | 'dd' => '<input type="text" name="guestname" size="25" value="' . $context['name'] . '" class="input_text" required>', |
1311 | 1311 | ); |
1312 | 1312 | |
1313 | 1313 | if (empty($modSettings['guest_post_no_email'])) |
1314 | 1314 | { |
1315 | 1315 | $context['posting_fields']['email'] = array( |
1316 | - 'dt' => '<span id="caption_email"' . (isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '') . '>' . $txt['email'] . '</span>', |
|
1316 | + 'dt' => '<span id="caption_email"' . (isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '') . '>' . $txt['email'] . '</span>', |
|
1317 | 1317 | 'dd' => '<input type="email" name="email" size="25" value="' . $context['email'] . '" class="input_text" required>', |
1318 | 1318 | ); |
1319 | 1319 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $smcFunc['db_free_result']($request); |
166 | 166 | |
167 | 167 | $feed_meta['title'] = ' - ' . strip_tags($board_info['name']); |
168 | - $feed_meta['source'] .= '?board=' . $board . '.0' ; |
|
168 | + $feed_meta['source'] .= '?board=' . $board . '.0'; |
|
169 | 169 | |
170 | 170 | $query_this_board = 'b.id_board = ' . $board; |
171 | 171 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | foreach ($xml_data as $item) |
391 | 391 | { |
392 | - $link = array_filter($item['content'], function ($e) { return ($e['tag'] == 'link'); }); |
|
392 | + $link = array_filter($item['content'], function($e) { return ($e['tag'] == 'link'); }); |
|
393 | 393 | $link = array_pop($link); |
394 | 394 | |
395 | 395 | echo ' |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | if (!empty($modSettings['search_simple_fulltext'])) |
208 | 208 | { |
209 | - if($smcFunc['db_title'] == "PostgreSQL") |
|
209 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
210 | 210 | { |
211 | 211 | $language_ftx = $smcFunc['db_search_language'](); |
212 | 212 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | // remove any indexed words that are used in the complex body search terms |
225 | 225 | $words['indexed_words'] = array_diff($words['indexed_words'], $words['complex_words']); |
226 | 226 | |
227 | - if($smcFunc['db_title'] == "PostgreSQL"){ |
|
227 | + if ($smcFunc['db_title'] == "PostgreSQL") { |
|
228 | 228 | $row = 0; |
229 | 229 | foreach ($words['indexed_words'] as $fulltextWord) { |
230 | 230 | $query_params['boolean_match'] .= ($row <> 0 ? '&' : ''); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | // if we have bool terms to search, add them in |
242 | 242 | if ($query_params['boolean_match']) { |
243 | - if($smcFunc['db_title'] == "PostgreSQL") |
|
243 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
244 | 244 | { |
245 | 245 | $language_ftx = $smcFunc['db_search_language'](); |
246 | 246 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | } |
255 | 255 | |
256 | - $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ( ' |
|
256 | + $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? (' |
|
257 | 257 | INSERT IGNORE INTO {db_prefix}' . $search_data['insert_into'] . ' |
258 | 258 | (' . implode(', ', array_keys($query_select)) . ')') : '') . ' |
259 | 259 | SELECT ' . implode(', ', $query_select) . ' |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | $version = $smcFunc['db_get_version'](); |
39 | 39 | // if we got a Beta Version |
40 | 40 | if (stripos($version, 'beta') !== false) |
41 | - $version = substr($version, 0, stripos($version, 'beta')).'.0'; |
|
41 | + $version = substr($version, 0, stripos($version, 'beta')) . '.0'; |
|
42 | 42 | // or RC |
43 | 43 | if (stripos($version, 'rc') !== false) |
44 | - $version = substr($version, 0, stripos($version, 'rc')).'.0'; |
|
44 | + $version = substr($version, 0, stripos($version, 'rc')) . '.0'; |
|
45 | 45 | |
46 | - if (version_compare($version,'9.5.0','>=')) |
|
46 | + if (version_compare($version, '9.5.0', '>=')) |
|
47 | 47 | $smcFunc['db_support_ignore'] = true; |
48 | 48 | } |
49 | 49 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | function smf_db_search_support($search_type) |
57 | 57 | { |
58 | - $supported_types = array('custom','fulltext'); |
|
58 | + $supported_types = array('custom', 'fulltext'); |
|
59 | 59 | |
60 | 60 | return in_array($search_type, $supported_types); |
61 | 61 | } |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | if (preg_match('~^\s*INSERT\sIGNORE~i', $db_string) != 0) |
110 | 110 | { |
111 | 111 | $db_string = preg_replace('~^\s*INSERT\sIGNORE~i', 'INSERT', $db_string); |
112 | - if ($smcFunc['db_support_ignore']){ |
|
112 | + if ($smcFunc['db_support_ignore']) { |
|
113 | 113 | //pg style "INSERT INTO.... ON CONFLICT DO NOTHING" |
114 | - $db_string = $db_string.' ON CONFLICT DO NOTHING'; |
|
114 | + $db_string = $db_string . ' ON CONFLICT DO NOTHING'; |
|
115 | 115 | } |
116 | 116 | else |
117 | 117 | { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $language_ftx = $modSettings['search_language']; |
169 | 169 | else |
170 | 170 | { |
171 | - $request = $smcFunc['db_query']('',' |
|
171 | + $request = $smcFunc['db_query']('', ' |
|
172 | 172 | SHOW default_text_search_config', |
173 | 173 | array() |
174 | 174 | ); |
@@ -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); |
@@ -2713,7 +2713,7 @@ discard block |
||
2713 | 2713 | for ($i = 0, $n = count($smileysfrom); $i < $n; $i++) |
2714 | 2714 | { |
2715 | 2715 | $specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES); |
2716 | - $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')). '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
2716 | + $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
2717 | 2717 | |
2718 | 2718 | $smileyPregReplacements[$smileysfrom[$i]] = $smileyCode; |
2719 | 2719 | |
@@ -2730,7 +2730,7 @@ discard block |
||
2730 | 2730 | |
2731 | 2731 | // Replace away! |
2732 | 2732 | $message = preg_replace_callback($smileyPregSearch, |
2733 | - function ($matches) use ($smileyPregReplacements) |
|
2733 | + function($matches) use ($smileyPregReplacements) |
|
2734 | 2734 | { |
2735 | 2735 | return $smileyPregReplacements[$matches[1]]; |
2736 | 2736 | }, $message); |
@@ -2796,13 +2796,13 @@ discard block |
||
2796 | 2796 | { |
2797 | 2797 | if (defined('SID') && SID != '') |
2798 | 2798 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&))((?:board|topic)=[^#]+?)(#[^"]*?)?$~', |
2799 | - function ($m) use ($scripturl) |
|
2799 | + function($m) use ($scripturl) |
|
2800 | 2800 | { |
2801 | - return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : ""); |
|
2801 | + return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : ""); |
|
2802 | 2802 | }, $setLocation); |
2803 | 2803 | else |
2804 | 2804 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~', |
2805 | - function ($m) use ($scripturl) |
|
2805 | + function($m) use ($scripturl) |
|
2806 | 2806 | { |
2807 | 2807 | return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : ""); |
2808 | 2808 | }, $setLocation); |
@@ -3125,7 +3125,7 @@ discard block |
||
3125 | 3125 | |
3126 | 3126 | // Add a generic "Are you sure?" confirmation message. |
3127 | 3127 | addInlineJavaScript(' |
3128 | - var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';'); |
|
3128 | + var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';'); |
|
3129 | 3129 | |
3130 | 3130 | // Now add the capping code for avatars. |
3131 | 3131 | 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') |
@@ -3486,7 +3486,7 @@ discard block |
||
3486 | 3486 | |
3487 | 3487 | else |
3488 | 3488 | echo ' |
3489 | - <script src="', $settings['theme_url'] ,'/scripts/minified', ($do_deferred ? '_deferred' : '') ,'.js', $minSeed ,'"></script>'; |
|
3489 | + <script src="', $settings['theme_url'], '/scripts/minified', ($do_deferred ? '_deferred' : ''), '.js', $minSeed, '"></script>'; |
|
3490 | 3490 | } |
3491 | 3491 | |
3492 | 3492 | // Inline JavaScript - Actually useful some times! |
@@ -3564,14 +3564,14 @@ discard block |
||
3564 | 3564 | |
3565 | 3565 | else |
3566 | 3566 | echo ' |
3567 | - <link rel="stylesheet" href="', $settings['theme_url'] ,'/css/minified.css', $minSeed ,'">'; |
|
3567 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/minified.css', $minSeed, '">'; |
|
3568 | 3568 | } |
3569 | 3569 | |
3570 | 3570 | // Print the rest after the minified files. |
3571 | 3571 | if (!empty($normal)) |
3572 | 3572 | foreach ($normal as $nf) |
3573 | 3573 | echo ' |
3574 | - <link rel="stylesheet" href="', $nf ,'">'; |
|
3574 | + <link rel="stylesheet" href="', $nf, '">'; |
|
3575 | 3575 | |
3576 | 3576 | if ($db_show_debug === true) |
3577 | 3577 | { |
@@ -3587,7 +3587,7 @@ discard block |
||
3587 | 3587 | <style>'; |
3588 | 3588 | |
3589 | 3589 | foreach ($context['css_header'] as $css) |
3590 | - echo $css .' |
|
3590 | + echo $css . ' |
|
3591 | 3591 | '; |
3592 | 3592 | |
3593 | 3593 | echo' |
@@ -3616,27 +3616,27 @@ discard block |
||
3616 | 3616 | return false; |
3617 | 3617 | |
3618 | 3618 | // Did we already did this? |
3619 | - $toCache = cache_get_data('minimized_'. $settings['theme_id'] .'_'. $type, 86400); |
|
3619 | + $toCache = cache_get_data('minimized_' . $settings['theme_id'] . '_' . $type, 86400); |
|
3620 | 3620 | |
3621 | 3621 | // Already done? |
3622 | 3622 | if (!empty($toCache)) |
3623 | 3623 | return true; |
3624 | 3624 | |
3625 | 3625 | // No namespaces, sorry! |
3626 | - $classType = 'MatthiasMullie\\Minify\\'. strtoupper($type); |
|
3626 | + $classType = 'MatthiasMullie\\Minify\\' . strtoupper($type); |
|
3627 | 3627 | |
3628 | 3628 | // Temp path. |
3629 | - $cTempPath = $settings['theme_dir'] .'/'. ($type == 'css' ? 'css' : 'scripts') .'/'; |
|
3629 | + $cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/'; |
|
3630 | 3630 | |
3631 | 3631 | // What kind of file are we going to create? |
3632 | - $toCreate = $cTempPath .'minified'. ($do_deferred ? '_deferred' : '') .'.'. $type; |
|
3632 | + $toCreate = $cTempPath . 'minified' . ($do_deferred ? '_deferred' : '') . '.' . $type; |
|
3633 | 3633 | |
3634 | 3634 | // File has to exists, if it isn't try to create it. |
3635 | 3635 | if ((!file_exists($toCreate) && @fopen($toCreate, 'w') === false) || !smf_chmod($toCreate)) |
3636 | 3636 | { |
3637 | 3637 | loadLanguage('Errors'); |
3638 | 3638 | log_error(sprintf($txt['file_not_created'], $toCreate), 'general'); |
3639 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null); |
|
3639 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null); |
|
3640 | 3640 | |
3641 | 3641 | // The process failed so roll back to print each individual file. |
3642 | 3642 | return $data; |
@@ -3671,14 +3671,14 @@ discard block |
||
3671 | 3671 | { |
3672 | 3672 | loadLanguage('Errors'); |
3673 | 3673 | log_error(sprintf($txt['file_not_created'], $toCreate), 'general'); |
3674 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null); |
|
3674 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null); |
|
3675 | 3675 | |
3676 | 3676 | // The process failed so roll back to print each individual file. |
3677 | 3677 | return $data; |
3678 | 3678 | } |
3679 | 3679 | |
3680 | 3680 | // And create a long lived cache entry. |
3681 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, $toCreate, 86400); |
|
3681 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, $toCreate, 86400); |
|
3682 | 3682 | |
3683 | 3683 | return true; |
3684 | 3684 | } |
@@ -3738,7 +3738,7 @@ discard block |
||
3738 | 3738 | else |
3739 | 3739 | $path = $modSettings['attachmentUploadDir']; |
3740 | 3740 | |
3741 | - return $path . '/' . $attachment_id . '_' . $file_hash .'.dat'; |
|
3741 | + return $path . '/' . $attachment_id . '_' . $file_hash . '.dat'; |
|
3742 | 3742 | } |
3743 | 3743 | |
3744 | 3744 | /** |
@@ -3782,10 +3782,10 @@ discard block |
||
3782 | 3782 | $valid_low = isValidIP($ip_parts[0]); |
3783 | 3783 | $valid_high = isValidIP($ip_parts[1]); |
3784 | 3784 | $count = 0; |
3785 | - $mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.'); |
|
3785 | + $mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.'); |
|
3786 | 3786 | $max = ($mode == ':' ? 'ffff' : '255'); |
3787 | 3787 | $min = 0; |
3788 | - if(!$valid_low) |
|
3788 | + if (!$valid_low) |
|
3789 | 3789 | { |
3790 | 3790 | $ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]); |
3791 | 3791 | $valid_low = isValidIP($ip_parts[0]); |
@@ -3799,7 +3799,7 @@ discard block |
||
3799 | 3799 | } |
3800 | 3800 | |
3801 | 3801 | $count = 0; |
3802 | - if(!$valid_high) |
|
3802 | + if (!$valid_high) |
|
3803 | 3803 | { |
3804 | 3804 | $ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]); |
3805 | 3805 | $valid_high = isValidIP($ip_parts[1]); |
@@ -3812,7 +3812,7 @@ discard block |
||
3812 | 3812 | } |
3813 | 3813 | } |
3814 | 3814 | |
3815 | - if($valid_high && $valid_low) |
|
3815 | + if ($valid_high && $valid_low) |
|
3816 | 3816 | { |
3817 | 3817 | $ip_array['low'] = $ip_parts[0]; |
3818 | 3818 | $ip_array['high'] = $ip_parts[1]; |
@@ -3994,7 +3994,7 @@ discard block |
||
3994 | 3994 | addInlineJavaScript(' |
3995 | 3995 | var user_menus = new smc_PopupMenu(); |
3996 | 3996 | user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup"); |
3997 | - user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true); |
|
3997 | + user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true); |
|
3998 | 3998 | if ($context['allow_pm']) |
3999 | 3999 | addInlineJavaScript(' |
4000 | 4000 | user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true); |
@@ -4619,7 +4619,7 @@ discard block |
||
4619 | 4619 | // No? try a fallback to $sourcedir |
4620 | 4620 | else |
4621 | 4621 | { |
4622 | - $absPath = $sourcedir .'/'. $file; |
|
4622 | + $absPath = $sourcedir . '/' . $file; |
|
4623 | 4623 | |
4624 | 4624 | if (file_exists($absPath)) |
4625 | 4625 | require_once($absPath); |
@@ -4700,15 +4700,15 @@ discard block |
||
4700 | 4700 | |
4701 | 4701 | // UTF-8 occurences of MS special characters |
4702 | 4702 | $findchars_utf8 = array( |
4703 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
4704 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
4705 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
4706 | - "\xe2\x80\x98", // left single curly quote |
|
4707 | - "\xe2\x80\x99", // right single curly quote |
|
4708 | - "\xe2\x80\x9c", // left double curly quote |
|
4709 | - "\xe2\x80\x9d", // right double curly quote |
|
4710 | - "\xe2\x80\x93", // en dash |
|
4711 | - "\xe2\x80\x94", // em dash |
|
4703 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
4704 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
4705 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
4706 | + "\xe2\x80\x98", // left single curly quote |
|
4707 | + "\xe2\x80\x99", // right single curly quote |
|
4708 | + "\xe2\x80\x9c", // left double curly quote |
|
4709 | + "\xe2\x80\x9d", // right double curly quote |
|
4710 | + "\xe2\x80\x93", // en dash |
|
4711 | + "\xe2\x80\x94", // em dash |
|
4712 | 4712 | ); |
4713 | 4713 | |
4714 | 4714 | // windows 1252 / iso equivalents |
@@ -4726,15 +4726,15 @@ discard block |
||
4726 | 4726 | |
4727 | 4727 | // safe replacements |
4728 | 4728 | $replacechars = array( |
4729 | - ',', // ‚ |
|
4730 | - ',,', // „ |
|
4731 | - '...', // … |
|
4732 | - "'", // ‘ |
|
4733 | - "'", // ’ |
|
4734 | - '"', // “ |
|
4735 | - '"', // ” |
|
4736 | - '-', // – |
|
4737 | - '--', // — |
|
4729 | + ',', // ‚ |
|
4730 | + ',,', // „ |
|
4731 | + '...', // … |
|
4732 | + "'", // ‘ |
|
4733 | + "'", // ’ |
|
4734 | + '"', // “ |
|
4735 | + '"', // ” |
|
4736 | + '-', // – |
|
4737 | + '--', // — |
|
4738 | 4738 | ); |
4739 | 4739 | |
4740 | 4740 | if ($context['utf8']) |
@@ -5152,7 +5152,7 @@ discard block |
||
5152 | 5152 | */ |
5153 | 5153 | function inet_dtop($bin) |
5154 | 5154 | { |
5155 | - if(empty($bin)) |
|
5155 | + if (empty($bin)) |
|
5156 | 5156 | return ''; |
5157 | 5157 | |
5158 | 5158 | global $db_type; |
@@ -5183,28 +5183,28 @@ discard block |
||
5183 | 5183 | */ |
5184 | 5184 | function _safe_serialize($value) |
5185 | 5185 | { |
5186 | - if(is_null($value)) |
|
5186 | + if (is_null($value)) |
|
5187 | 5187 | return 'N;'; |
5188 | 5188 | |
5189 | - if(is_bool($value)) |
|
5190 | - return 'b:'. (int) $value .';'; |
|
5189 | + if (is_bool($value)) |
|
5190 | + return 'b:' . (int) $value . ';'; |
|
5191 | 5191 | |
5192 | - if(is_int($value)) |
|
5193 | - return 'i:'. $value .';'; |
|
5192 | + if (is_int($value)) |
|
5193 | + return 'i:' . $value . ';'; |
|
5194 | 5194 | |
5195 | - if(is_float($value)) |
|
5196 | - return 'd:'. str_replace(',', '.', $value) .';'; |
|
5195 | + if (is_float($value)) |
|
5196 | + return 'd:' . str_replace(',', '.', $value) . ';'; |
|
5197 | 5197 | |
5198 | - if(is_string($value)) |
|
5199 | - return 's:'. strlen($value) .':"'. $value .'";'; |
|
5198 | + if (is_string($value)) |
|
5199 | + return 's:' . strlen($value) . ':"' . $value . '";'; |
|
5200 | 5200 | |
5201 | - if(is_array($value)) |
|
5201 | + if (is_array($value)) |
|
5202 | 5202 | { |
5203 | 5203 | $out = ''; |
5204 | - foreach($value as $k => $v) |
|
5204 | + foreach ($value as $k => $v) |
|
5205 | 5205 | $out .= _safe_serialize($k) . _safe_serialize($v); |
5206 | 5206 | |
5207 | - return 'a:'. count($value) .':{'. $out .'}'; |
|
5207 | + return 'a:' . count($value) . ':{' . $out . '}'; |
|
5208 | 5208 | } |
5209 | 5209 | |
5210 | 5210 | // safe_serialize cannot serialize resources or objects. |
@@ -5246,7 +5246,7 @@ discard block |
||
5246 | 5246 | function _safe_unserialize($str) |
5247 | 5247 | { |
5248 | 5248 | // Input is not a string. |
5249 | - if(empty($str) || !is_string($str)) |
|
5249 | + if (empty($str) || !is_string($str)) |
|
5250 | 5250 | return false; |
5251 | 5251 | |
5252 | 5252 | $stack = array(); |
@@ -5260,40 +5260,40 @@ discard block |
||
5260 | 5260 | * 3 - in array, expecting value or another array |
5261 | 5261 | */ |
5262 | 5262 | $state = 0; |
5263 | - while($state != 1) |
|
5263 | + while ($state != 1) |
|
5264 | 5264 | { |
5265 | 5265 | $type = isset($str[0]) ? $str[0] : ''; |
5266 | - if($type == '}') |
|
5266 | + if ($type == '}') |
|
5267 | 5267 | $str = substr($str, 1); |
5268 | 5268 | |
5269 | - else if($type == 'N' && $str[1] == ';') |
|
5269 | + else if ($type == 'N' && $str[1] == ';') |
|
5270 | 5270 | { |
5271 | 5271 | $value = null; |
5272 | 5272 | $str = substr($str, 2); |
5273 | 5273 | } |
5274 | - else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
5274 | + else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
5275 | 5275 | { |
5276 | 5276 | $value = $matches[1] == '1' ? true : false; |
5277 | 5277 | $str = substr($str, 4); |
5278 | 5278 | } |
5279 | - else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
5279 | + else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
5280 | 5280 | { |
5281 | - $value = (int)$matches[1]; |
|
5281 | + $value = (int) $matches[1]; |
|
5282 | 5282 | $str = $matches[2]; |
5283 | 5283 | } |
5284 | - else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
5284 | + else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
5285 | 5285 | { |
5286 | - $value = (float)$matches[1]; |
|
5286 | + $value = (float) $matches[1]; |
|
5287 | 5287 | $str = $matches[3]; |
5288 | 5288 | } |
5289 | - else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";') |
|
5289 | + else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";') |
|
5290 | 5290 | { |
5291 | - $value = substr($matches[2], 0, (int)$matches[1]); |
|
5292 | - $str = substr($matches[2], (int)$matches[1] + 2); |
|
5291 | + $value = substr($matches[2], 0, (int) $matches[1]); |
|
5292 | + $str = substr($matches[2], (int) $matches[1] + 2); |
|
5293 | 5293 | } |
5294 | - else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
5294 | + else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
5295 | 5295 | { |
5296 | - $expectedLength = (int)$matches[1]; |
|
5296 | + $expectedLength = (int) $matches[1]; |
|
5297 | 5297 | $str = $matches[2]; |
5298 | 5298 | } |
5299 | 5299 | |
@@ -5301,10 +5301,10 @@ discard block |
||
5301 | 5301 | else |
5302 | 5302 | return false; |
5303 | 5303 | |
5304 | - switch($state) |
|
5304 | + switch ($state) |
|
5305 | 5305 | { |
5306 | 5306 | case 3: // In array, expecting value or another array. |
5307 | - if($type == 'a') |
|
5307 | + if ($type == 'a') |
|
5308 | 5308 | { |
5309 | 5309 | $stack[] = &$list; |
5310 | 5310 | $list[$key] = array(); |
@@ -5313,7 +5313,7 @@ discard block |
||
5313 | 5313 | $state = 2; |
5314 | 5314 | break; |
5315 | 5315 | } |
5316 | - if($type != '}') |
|
5316 | + if ($type != '}') |
|
5317 | 5317 | { |
5318 | 5318 | $list[$key] = $value; |
5319 | 5319 | $state = 2; |
@@ -5324,29 +5324,29 @@ discard block |
||
5324 | 5324 | return false; |
5325 | 5325 | |
5326 | 5326 | case 2: // in array, expecting end of array or a key |
5327 | - if($type == '}') |
|
5327 | + if ($type == '}') |
|
5328 | 5328 | { |
5329 | 5329 | // Array size is less than expected. |
5330 | - if(count($list) < end($expected)) |
|
5330 | + if (count($list) < end($expected)) |
|
5331 | 5331 | return false; |
5332 | 5332 | |
5333 | 5333 | unset($list); |
5334 | - $list = &$stack[count($stack)-1]; |
|
5334 | + $list = &$stack[count($stack) - 1]; |
|
5335 | 5335 | array_pop($stack); |
5336 | 5336 | |
5337 | 5337 | // Go to terminal state if we're at the end of the root array. |
5338 | 5338 | array_pop($expected); |
5339 | 5339 | |
5340 | - if(count($expected) == 0) |
|
5340 | + if (count($expected) == 0) |
|
5341 | 5341 | $state = 1; |
5342 | 5342 | |
5343 | 5343 | break; |
5344 | 5344 | } |
5345 | 5345 | |
5346 | - if($type == 'i' || $type == 's') |
|
5346 | + if ($type == 'i' || $type == 's') |
|
5347 | 5347 | { |
5348 | 5348 | // Array size exceeds expected length. |
5349 | - if(count($list) >= end($expected)) |
|
5349 | + if (count($list) >= end($expected)) |
|
5350 | 5350 | return false; |
5351 | 5351 | |
5352 | 5352 | $key = $value; |
@@ -5359,7 +5359,7 @@ discard block |
||
5359 | 5359 | |
5360 | 5360 | // Expecting array or value. |
5361 | 5361 | case 0: |
5362 | - if($type == 'a') |
|
5362 | + if ($type == 'a') |
|
5363 | 5363 | { |
5364 | 5364 | $data = array(); |
5365 | 5365 | $list = &$data; |
@@ -5368,7 +5368,7 @@ discard block |
||
5368 | 5368 | break; |
5369 | 5369 | } |
5370 | 5370 | |
5371 | - if($type != '}') |
|
5371 | + if ($type != '}') |
|
5372 | 5372 | { |
5373 | 5373 | $data = $value; |
5374 | 5374 | $state = 1; |
@@ -5381,7 +5381,7 @@ discard block |
||
5381 | 5381 | } |
5382 | 5382 | |
5383 | 5383 | // Trailing data in input. |
5384 | - if(!empty($str)) |
|
5384 | + if (!empty($str)) |
|
5385 | 5385 | return false; |
5386 | 5386 | |
5387 | 5387 | return $data; |
@@ -5435,7 +5435,7 @@ discard block |
||
5435 | 5435 | // Set different modes. |
5436 | 5436 | $chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666); |
5437 | 5437 | |
5438 | - foreach($chmodValues as $val) |
|
5438 | + foreach ($chmodValues as $val) |
|
5439 | 5439 | { |
5440 | 5440 | // If it's writable, break out of the loop. |
5441 | 5441 | if (is_writable($file)) |
@@ -5470,13 +5470,13 @@ discard block |
||
5470 | 5470 | $returnArray = @json_decode($json, $returnAsArray); |
5471 | 5471 | |
5472 | 5472 | // PHP 5.3 so no json_last_error_msg() |
5473 | - switch(json_last_error()) |
|
5473 | + switch (json_last_error()) |
|
5474 | 5474 | { |
5475 | 5475 | case JSON_ERROR_NONE: |
5476 | 5476 | $jsonError = false; |
5477 | 5477 | break; |
5478 | 5478 | case JSON_ERROR_DEPTH: |
5479 | - $jsonError = 'JSON_ERROR_DEPTH'; |
|
5479 | + $jsonError = 'JSON_ERROR_DEPTH'; |
|
5480 | 5480 | break; |
5481 | 5481 | case JSON_ERROR_STATE_MISMATCH: |
5482 | 5482 | $jsonError = 'JSON_ERROR_STATE_MISMATCH'; |
@@ -5504,10 +5504,10 @@ discard block |
||
5504 | 5504 | loadLanguage('Errors'); |
5505 | 5505 | |
5506 | 5506 | if (!empty($jsonDebug)) |
5507 | - log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
5507 | + log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
5508 | 5508 | |
5509 | 5509 | else |
5510 | - log_error($txt['json_'. $jsonError], 'critical'); |
|
5510 | + log_error($txt['json_' . $jsonError], 'critical'); |
|
5511 | 5511 | |
5512 | 5512 | // Everyone expects an array. |
5513 | 5513 | return array(); |
@@ -5611,7 +5611,7 @@ discard block |
||
5611 | 5611 | }); |
5612 | 5612 | |
5613 | 5613 | // Convert Punycode to Unicode |
5614 | - $tlds = array_map(function ($input) { |
|
5614 | + $tlds = array_map(function($input) { |
|
5615 | 5615 | $prefix = 'xn--'; |
5616 | 5616 | $safe_char = 0xFFFC; |
5617 | 5617 | $base = 36; |
@@ -5627,7 +5627,7 @@ discard block |
||
5627 | 5627 | |
5628 | 5628 | foreach ($enco_parts as $encoded) |
5629 | 5629 | { |
5630 | - if (strpos($encoded,$prefix) !== 0 || strlen(trim(str_replace($prefix,'',$encoded))) == 0) |
|
5630 | + if (strpos($encoded, $prefix) !== 0 || strlen(trim(str_replace($prefix, '', $encoded))) == 0) |
|
5631 | 5631 | { |
5632 | 5632 | $output_parts[] = $encoded; |
5633 | 5633 | continue; |
@@ -5638,7 +5638,7 @@ discard block |
||
5638 | 5638 | $idx = 0; |
5639 | 5639 | $char = 0x80; |
5640 | 5640 | $decoded = array(); |
5641 | - $output=''; |
|
5641 | + $output = ''; |
|
5642 | 5642 | $delim_pos = strrpos($encoded, '-'); |
5643 | 5643 | |
5644 | 5644 | if ($delim_pos > strlen($prefix)) |
@@ -5654,7 +5654,7 @@ discard block |
||
5654 | 5654 | |
5655 | 5655 | for ($enco_idx = $delim_pos ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) |
5656 | 5656 | { |
5657 | - for ($old_idx = $idx, $w = 1, $k = $base; 1 ; $k += $base) |
|
5657 | + for ($old_idx = $idx, $w = 1, $k = $base; 1; $k += $base) |
|
5658 | 5658 | { |
5659 | 5659 | $cp = ord($encoded{$enco_idx++}); |
5660 | 5660 | $digit = ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $base)); |
@@ -5695,15 +5695,15 @@ discard block |
||
5695 | 5695 | |
5696 | 5696 | // 2 bytes |
5697 | 5697 | elseif ($v < (1 << 11)) |
5698 | - $output .= chr(192+($v >> 6)) . chr(128+($v & 63)); |
|
5698 | + $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); |
|
5699 | 5699 | |
5700 | 5700 | // 3 bytes |
5701 | 5701 | elseif ($v < (1 << 16)) |
5702 | - $output .= chr(224+($v >> 12)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63)); |
|
5702 | + $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
5703 | 5703 | |
5704 | 5704 | // 4 bytes |
5705 | 5705 | elseif ($v < (1 << 21)) |
5706 | - $output .= chr(240+($v >> 18)) . chr(128+(($v >> 12) & 63)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63)); |
|
5706 | + $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
5707 | 5707 | |
5708 | 5708 | // 'Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k |
5709 | 5709 | else |
@@ -5810,7 +5810,7 @@ discard block |
||
5810 | 5810 | } |
5811 | 5811 | |
5812 | 5812 | // This recursive function creates the index array from the strings |
5813 | - $add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
5813 | + $add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
5814 | 5814 | { |
5815 | 5815 | static $depth = 0; |
5816 | 5816 | $depth++; |
@@ -5837,7 +5837,7 @@ discard block |
||
5837 | 5837 | }; |
5838 | 5838 | |
5839 | 5839 | // This recursive function turns the index array into a regular expression |
5840 | - $index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex) |
|
5840 | + $index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex) |
|
5841 | 5841 | { |
5842 | 5842 | static $depth = 0; |
5843 | 5843 | $depth++; |
@@ -5861,11 +5861,11 @@ discard block |
||
5861 | 5861 | |
5862 | 5862 | if (count(array_keys($value)) == 1) |
5863 | 5863 | { |
5864 | - $new_key_array = explode('(?'.'>', $sub_regex); |
|
5864 | + $new_key_array = explode('(?' . '>', $sub_regex); |
|
5865 | 5865 | $new_key .= $new_key_array[0]; |
5866 | 5866 | } |
5867 | 5867 | else |
5868 | - $sub_regex = '(?'.'>' . $sub_regex . ')'; |
|
5868 | + $sub_regex = '(?' . '>' . $sub_regex . ')'; |
|
5869 | 5869 | } |
5870 | 5870 | |
5871 | 5871 | if ($depth > 1) |
@@ -5905,7 +5905,7 @@ discard block |
||
5905 | 5905 | $index = $add_string_to_index($string, $index); |
5906 | 5906 | |
5907 | 5907 | while (!empty($index)) |
5908 | - $regexes[] = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
5908 | + $regexes[] = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
5909 | 5909 | |
5910 | 5910 | // Restore PHP's internal character encoding to whatever it was originally |
5911 | 5911 | if (!empty($current_encoding)) |