@@ -310,7 +310,7 @@ |
||
| 310 | 310 | { |
| 311 | 311 | /** |
| 312 | 312 | * Constants for notification types. |
| 313 | - */ |
|
| 313 | + */ |
|
| 314 | 314 | const RECEIVE_NOTIFY_EMAIL = 0x02; |
| 315 | 315 | const RECEIVE_NOTIFY_ALERT = 0x01; |
| 316 | 316 | |
@@ -93,7 +93,6 @@ |
||
| 93 | 93 | if ($ts <= 0 || $ts % 15 != 0 || time() - $ts < 0 || time() - $ts > 20) |
| 94 | 94 | obExit_cron(); |
| 95 | 95 | } |
| 96 | - |
|
| 97 | 96 | else |
| 98 | 97 | $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0'; |
| 99 | 98 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | /** |
| 21 | 21 | * Constants for reply types. |
| 22 | - */ |
|
| 22 | + */ |
|
| 23 | 23 | const NOTIFY_TYPE_REPLY_AND_MODIFY = 1; |
| 24 | 24 | const NOTIFY_TYPE_REPLY_AND_TOPIC_START_FOLLOWING = 2; |
| 25 | 25 | const NOTIFY_TYPE_ONLY_REPLIES = 3; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Constants for frequencies. |
| 30 | - */ |
|
| 30 | + */ |
|
| 31 | 31 | const FREQUENCY_NOTHING = 0; |
| 32 | 32 | const FREQUENCY_EVERYTHING = 1; |
| 33 | 33 | const FREQUENCY_FIRST_UNREAD_MSG = 2; |
@@ -266,7 +266,6 @@ |
||
| 266 | 266 | $user_info = $real_user_info; |
| 267 | 267 | unset($real_user_info); |
| 268 | 268 | } |
| 269 | - |
|
| 270 | 269 | else |
| 271 | 270 | $user_info = null; |
| 272 | 271 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | if ($type == 'edit') |
| 119 | 119 | { |
| 120 | 120 | // Filter out members who have already been notified about this post's topic |
| 121 | - $unnotified = array_filter($watched, function ($member) |
|
| 121 | + $unnotified = array_filter($watched, function($member) |
|
| 122 | 122 | { |
| 123 | 123 | return empty($member['sent']); |
| 124 | 124 | }); |
@@ -204,8 +204,7 @@ discard block |
||
| 204 | 204 | if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($prefs[$member_id])) |
| 205 | 205 | { |
| 206 | 206 | $pref = !empty($prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ? |
| 207 | - $prefs[$member_id]['topic_notify_' . $topicOptions['id']] : |
|
| 208 | - (!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0); |
|
| 207 | + $prefs[$member_id]['topic_notify_' . $topicOptions['id']] : (!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0); |
|
| 209 | 208 | |
| 210 | 209 | $message_type = 'notification_' . $type; |
| 211 | 210 | |
@@ -224,8 +223,7 @@ discard block |
||
| 224 | 223 | elseif ($type == 'topic') |
| 225 | 224 | { |
| 226 | 225 | $pref = !empty($prefs[$member_id]['board_notify_' . $topicOptions['board']]) ? |
| 227 | - $prefs[$member_id]['board_notify_' . $topicOptions['board']] : |
|
| 228 | - (!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0); |
|
| 226 | + $prefs[$member_id]['board_notify_' . $topicOptions['board']] : (!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0); |
|
| 229 | 227 | |
| 230 | 228 | $content_type = 'board'; |
| 231 | 229 | |
@@ -355,8 +355,8 @@ |
||
| 355 | 355 | elseif (isset($_POST['delall']) && isset($filter)) |
| 356 | 356 | { |
| 357 | 357 | // ip need a different placeholder type |
| 358 | - $filter_type = $filter['variable'] == 'ip'? 'inet' : 'string'; |
|
| 359 | - $filter_op = $filter['variable'] == 'ip'? '=' : 'LIKE'; |
|
| 358 | + $filter_type = $filter['variable'] == 'ip' ? 'inet' : 'string'; |
|
| 359 | + $filter_op = $filter['variable'] == 'ip' ? '=' : 'LIKE'; |
|
| 360 | 360 | $smcFunc['db_query']('', ' |
| 361 | 361 | DELETE FROM {db_prefix}log_errors |
| 362 | 362 | WHERE ' . $filter['variable'] . ' ' . $filter_op . ' {' . $filter_type . ':filter}', |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | { |
| 378 | 378 | $val = 'CASE '; |
| 379 | 379 | foreach ($members as $k => $v) |
| 380 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' '; |
|
| 380 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' '; |
|
| 381 | 381 | |
| 382 | 382 | $val = $val . ' END'; |
| 383 | 383 | $type = 'raw'; |
@@ -1041,11 +1041,11 @@ discard block |
||
| 1041 | 1041 | // Anything that isn't a specification, punctuation mark, or whitespace. |
| 1042 | 1042 | '~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
| 1043 | 1043 | // A series of punctuation marks (except %), possibly separated by whitespace. |
| 1044 | - '~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
| 1044 | + '~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
| 1045 | 1045 | // Unwanted trailing punctuation and whitespace. |
| 1046 | - '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
| 1046 | + '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
| 1047 | 1047 | // Unwanted opening punctuation and whitespace. |
| 1048 | - '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
| 1048 | + '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
| 1049 | 1049 | ), |
| 1050 | 1050 | array( |
| 1051 | 1051 | '', |
@@ -1460,7 +1460,7 @@ discard block |
||
| 1460 | 1460 | $width = !empty($width) ? ' width="' . $width . '"' : ''; |
| 1461 | 1461 | $height = !empty($height) ? ' height="' . $height . '"' : ''; |
| 1462 | 1462 | |
| 1463 | - $returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="'. $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
| 1463 | + $returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="' . $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
| 1464 | 1464 | } |
| 1465 | 1465 | // Audio. |
| 1466 | 1466 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1468,7 +1468,7 @@ discard block |
||
| 1468 | 1468 | $width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;'; |
| 1469 | 1469 | $height = !empty($height) ? 'height: ' . $height . 'px;' : ''; |
| 1470 | 1470 | |
| 1471 | - $returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="'. $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>'; |
|
| 1471 | + $returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="' . $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>'; |
|
| 1472 | 1472 | } |
| 1473 | 1473 | // Anything else. |
| 1474 | 1474 | else |
@@ -1631,7 +1631,7 @@ discard block |
||
| 1631 | 1631 | 'type' => 'unparsed_commas_content', |
| 1632 | 1632 | 'test' => '\d+,\d+\]', |
| 1633 | 1633 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
| 1634 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1634 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1635 | 1635 | { |
| 1636 | 1636 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
| 1637 | 1637 | if (empty($scheme)) |
@@ -2169,12 +2169,12 @@ discard block |
||
| 2169 | 2169 | $codes[] = array( |
| 2170 | 2170 | 'tag' => 'cowsay', |
| 2171 | 2171 | 'parameters' => array( |
| 2172 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
| 2172 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
| 2173 | 2173 | { |
| 2174 | 2174 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
| 2175 | 2175 | }, |
| 2176 | 2176 | ), |
| 2177 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
| 2177 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
| 2178 | 2178 | { |
| 2179 | 2179 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
| 2180 | 2180 | }, |
@@ -3546,7 +3546,7 @@ discard block |
||
| 3546 | 3546 | if ($fp != false) |
| 3547 | 3547 | { |
| 3548 | 3548 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
| 3549 | - fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: '. SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n"); |
|
| 3549 | + fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: ' . SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n"); |
|
| 3550 | 3550 | |
| 3551 | 3551 | // Read in the HTTP/1.1 or whatever. |
| 3552 | 3552 | $test = substr(fgets($fp, 11), -1); |
@@ -4150,7 +4150,7 @@ discard block |
||
| 4150 | 4150 | $toMinify = array(); |
| 4151 | 4151 | $normal = array(); |
| 4152 | 4152 | |
| 4153 | - usort($context['css_files'], function ($a, $b) |
|
| 4153 | + usort($context['css_files'], function($a, $b) |
|
| 4154 | 4154 | { |
| 4155 | 4155 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
| 4156 | 4156 | }); |
@@ -5446,7 +5446,7 @@ discard block |
||
| 5446 | 5446 | { |
| 5447 | 5447 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
| 5448 | 5448 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 5449 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 5449 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 5450 | 5450 | if ($keep_alive) |
| 5451 | 5451 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
| 5452 | 5452 | else |
@@ -5456,7 +5456,7 @@ discard block |
||
| 5456 | 5456 | { |
| 5457 | 5457 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
| 5458 | 5458 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 5459 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 5459 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 5460 | 5460 | if ($keep_alive) |
| 5461 | 5461 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
| 5462 | 5462 | else |
@@ -5704,13 +5704,13 @@ discard block |
||
| 5704 | 5704 | |
| 5705 | 5705 | // UTF-8 occurences of MS special characters |
| 5706 | 5706 | $findchars_utf8 = array( |
| 5707 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5708 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5709 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5710 | - "\xe2\x80\x98", // left single curly quote |
|
| 5711 | - "\xe2\x80\x99", // right single curly quote |
|
| 5712 | - "\xe2\x80\x9c", // left double curly quote |
|
| 5713 | - "\xe2\x80\x9d", // right double curly quote |
|
| 5707 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5708 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5709 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5710 | + "\xe2\x80\x98", // left single curly quote |
|
| 5711 | + "\xe2\x80\x99", // right single curly quote |
|
| 5712 | + "\xe2\x80\x9c", // left double curly quote |
|
| 5713 | + "\xe2\x80\x9d", // right double curly quote |
|
| 5714 | 5714 | ); |
| 5715 | 5715 | |
| 5716 | 5716 | // windows 1252 / iso equivalents |
@@ -5726,13 +5726,13 @@ discard block |
||
| 5726 | 5726 | |
| 5727 | 5727 | // safe replacements |
| 5728 | 5728 | $replacechars = array( |
| 5729 | - ',', // ‚ |
|
| 5730 | - ',,', // „ |
|
| 5731 | - '...', // … |
|
| 5732 | - "'", // ‘ |
|
| 5733 | - "'", // ’ |
|
| 5734 | - '"', // “ |
|
| 5735 | - '"', // ” |
|
| 5729 | + ',', // ‚ |
|
| 5730 | + ',,', // „ |
|
| 5731 | + '...', // … |
|
| 5732 | + "'", // ‘ |
|
| 5733 | + "'", // ’ |
|
| 5734 | + '"', // “ |
|
| 5735 | + '"', // ” |
|
| 5736 | 5736 | ); |
| 5737 | 5737 | |
| 5738 | 5738 | if ($context['utf8']) |
@@ -6917,7 +6917,7 @@ discard block |
||
| 6917 | 6917 | EXISTS ( |
| 6918 | 6918 | SELECT bpv.id_board |
| 6919 | 6919 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 6920 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
| 6920 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
| 6921 | 6921 | AND bpv.deny = 0 |
| 6922 | 6922 | AND bpv.id_board = b.id_board |
| 6923 | 6923 | )'; |
@@ -6927,7 +6927,7 @@ discard block |
||
| 6927 | 6927 | AND NOT EXISTS ( |
| 6928 | 6928 | SELECT bpv.id_board |
| 6929 | 6929 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 6930 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
| 6930 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
| 6931 | 6931 | AND bpv.deny = 1 |
| 6932 | 6932 | AND bpv.id_board = b.id_board |
| 6933 | 6933 | )'; |
@@ -7198,8 +7198,8 @@ discard block |
||
| 7198 | 7198 | $i = 0; |
| 7199 | 7199 | while (empty($done)) |
| 7200 | 7200 | { |
| 7201 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
| 7202 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
| 7201 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
| 7202 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
| 7203 | 7203 | else |
| 7204 | 7204 | $done = true; |
| 7205 | 7205 | } |
@@ -7209,8 +7209,8 @@ discard block |
||
| 7209 | 7209 | $i = 0; |
| 7210 | 7210 | while (empty($done)) |
| 7211 | 7211 | { |
| 7212 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
| 7213 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
| 7212 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
| 7213 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
| 7214 | 7214 | else |
| 7215 | 7215 | $done = true; |
| 7216 | 7216 | } |
@@ -279,7 +279,6 @@ discard block |
||
| 279 | 279 | $condition = 'id_member IN ({array_int:members})'; |
| 280 | 280 | $parameters['members'] = $members; |
| 281 | 281 | } |
| 282 | - |
|
| 283 | 282 | elseif ($members === null) |
| 284 | 283 | $condition = '1=1'; |
| 285 | 284 | |
@@ -382,11 +381,9 @@ discard block |
||
| 382 | 381 | $val = $val . ' END'; |
| 383 | 382 | $type = 'raw'; |
| 384 | 383 | } |
| 385 | - |
|
| 386 | 384 | else |
| 387 | 385 | $val = alert_count($members, true); |
| 388 | 386 | } |
| 389 | - |
|
| 390 | 387 | elseif ($type == 'int' && ($val === '+' || $val === '-')) |
| 391 | 388 | { |
| 392 | 389 | $val = $var . ' ' . $val . ' 1'; |
@@ -2170,12 +2167,12 @@ discard block |
||
| 2170 | 2167 | 'tag' => 'cowsay', |
| 2171 | 2168 | 'parameters' => array( |
| 2172 | 2169 | 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
| 2173 | - { |
|
| 2170 | + { |
|
| 2174 | 2171 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
| 2175 | 2172 | }, |
| 2176 | 2173 | ), |
| 2177 | 2174 | 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
| 2178 | - { |
|
| 2175 | + { |
|
| 2179 | 2176 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
| 2180 | 2177 | }, |
| 2181 | 2178 | ), |
@@ -3273,7 +3270,7 @@ discard block |
||
| 3273 | 3270 | |
| 3274 | 3271 | // Replace away! |
| 3275 | 3272 | $message = preg_replace_callback($smileyPregSearch, function($matches) use ($smileyPregReplacements) |
| 3276 | - { |
|
| 3273 | + { |
|
| 3277 | 3274 | return $smileyPregReplacements[$matches[1]]; |
| 3278 | 3275 | }, $message); |
| 3279 | 3276 | } |
@@ -4071,7 +4068,6 @@ discard block |
||
| 4071 | 4068 | if (!isset($minSeed) && isset($js_file['options']['seed'])) |
| 4072 | 4069 | $minSeed = $js_file['options']['seed']; |
| 4073 | 4070 | } |
| 4074 | - |
|
| 4075 | 4071 | else |
| 4076 | 4072 | { |
| 4077 | 4073 | echo ' |
@@ -6354,7 +6350,6 @@ discard block |
||
| 6354 | 6350 | $isWritable = true; |
| 6355 | 6351 | break; |
| 6356 | 6352 | } |
| 6357 | - |
|
| 6358 | 6353 | else |
| 6359 | 6354 | @chmod($file, $val); |
| 6360 | 6355 | } |
@@ -7286,7 +7281,6 @@ discard block |
||
| 7286 | 7281 | |
| 7287 | 7282 | $length += array_length($value, $deep_count); |
| 7288 | 7283 | } |
| 7289 | - |
|
| 7290 | 7284 | else |
| 7291 | 7285 | $length += strlen($value); |
| 7292 | 7286 | } |
@@ -7239,32 +7239,32 @@ discard block |
||
| 7239 | 7239 | */ |
| 7240 | 7240 | function truncate_array($array, $max_length = 1900, $deep = 3) |
| 7241 | 7241 | { |
| 7242 | - $array = (array) $array; |
|
| 7242 | + $array = (array) $array; |
|
| 7243 | 7243 | |
| 7244 | - $curr_length = array_length($array, $deep); |
|
| 7244 | + $curr_length = array_length($array, $deep); |
|
| 7245 | 7245 | |
| 7246 | - if ($curr_length <= $max_length) |
|
| 7247 | - return $array; |
|
| 7246 | + if ($curr_length <= $max_length) |
|
| 7247 | + return $array; |
|
| 7248 | 7248 | |
| 7249 | - else |
|
| 7250 | - { |
|
| 7251 | - // Truncate each element's value to a reasonable length |
|
| 7252 | - $param_max = floor($max_length / count($array)); |
|
| 7249 | + else |
|
| 7250 | + { |
|
| 7251 | + // Truncate each element's value to a reasonable length |
|
| 7252 | + $param_max = floor($max_length / count($array)); |
|
| 7253 | 7253 | |
| 7254 | - $current_deep = $deep - 1; |
|
| 7254 | + $current_deep = $deep - 1; |
|
| 7255 | 7255 | |
| 7256 | - foreach ($array as $key => &$value) |
|
| 7257 | - { |
|
| 7258 | - if (is_array($value)) |
|
| 7259 | - if ($current_deep > 0) |
|
| 7260 | - $value = truncate_array($value, $current_deep); |
|
| 7256 | + foreach ($array as $key => &$value) |
|
| 7257 | + { |
|
| 7258 | + if (is_array($value)) |
|
| 7259 | + if ($current_deep > 0) |
|
| 7260 | + $value = truncate_array($value, $current_deep); |
|
| 7261 | 7261 | |
| 7262 | - else |
|
| 7263 | - $value = substr($value, 0, $param_max - strlen($key) - 5); |
|
| 7264 | - } |
|
| 7262 | + else |
|
| 7263 | + $value = substr($value, 0, $param_max - strlen($key) - 5); |
|
| 7264 | + } |
|
| 7265 | 7265 | |
| 7266 | - return $array; |
|
| 7267 | - } |
|
| 7266 | + return $array; |
|
| 7267 | + } |
|
| 7268 | 7268 | } |
| 7269 | 7269 | |
| 7270 | 7270 | /** |
@@ -7275,29 +7275,29 @@ discard block |
||
| 7275 | 7275 | */ |
| 7276 | 7276 | function array_length($array, $deep = 3) |
| 7277 | 7277 | { |
| 7278 | - // Work with arrays |
|
| 7279 | - $array = (array) $array; |
|
| 7280 | - $length = 0; |
|
| 7278 | + // Work with arrays |
|
| 7279 | + $array = (array) $array; |
|
| 7280 | + $length = 0; |
|
| 7281 | 7281 | |
| 7282 | - $deep_count = $deep - 1; |
|
| 7282 | + $deep_count = $deep - 1; |
|
| 7283 | 7283 | |
| 7284 | - foreach ($array as $value) |
|
| 7285 | - { |
|
| 7286 | - // Recursive? |
|
| 7287 | - if (is_array($value)) |
|
| 7288 | - { |
|
| 7289 | - // No can't do |
|
| 7290 | - if ($deep_count <= 0) |
|
| 7291 | - continue; |
|
| 7284 | + foreach ($array as $value) |
|
| 7285 | + { |
|
| 7286 | + // Recursive? |
|
| 7287 | + if (is_array($value)) |
|
| 7288 | + { |
|
| 7289 | + // No can't do |
|
| 7290 | + if ($deep_count <= 0) |
|
| 7291 | + continue; |
|
| 7292 | 7292 | |
| 7293 | - $length += array_length($value, $deep_count); |
|
| 7294 | - } |
|
| 7293 | + $length += array_length($value, $deep_count); |
|
| 7294 | + } |
|
| 7295 | 7295 | |
| 7296 | - else |
|
| 7297 | - $length += strlen($value); |
|
| 7298 | - } |
|
| 7296 | + else |
|
| 7297 | + $length += strlen($value); |
|
| 7298 | + } |
|
| 7299 | 7299 | |
| 7300 | - return $length; |
|
| 7300 | + return $length; |
|
| 7301 | 7301 | } |
| 7302 | 7302 | |
| 7303 | 7303 | /** |
@@ -1396,7 +1396,9 @@ |
||
| 1396 | 1396 | |
| 1397 | 1397 | // Figure out the filename we'll tell the browser. |
| 1398 | 1398 | $datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile'); |
| 1399 | - $included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
| 1399 | + $included_desc = array_map(function ($datatype) use ($txt) |
|
| 1400 | + { |
|
| 1401 | +return $txt[$datatype]; }, $datatypes); |
|
| 1400 | 1402 | |
| 1401 | 1403 | $dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc); |
| 1402 | 1404 | $dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename))))); |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | |
| 469 | 469 | // Figure out the filename we'll tell the browser. |
| 470 | 470 | $datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile'); |
| 471 | - $included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
| 471 | + $included_desc = array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
| 472 | 472 | |
| 473 | 473 | $dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc); |
| 474 | 474 | $dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename))))); |
@@ -790,9 +790,9 @@ discard block |
||
| 790 | 790 | $context['xslt_settings'] = array( |
| 791 | 791 | // Do not change any of these to HTTPS URLs. For explanation, see comments in the buildXmlFeed() function. |
| 792 | 792 | 'namespaces' => array( |
| 793 | - 'xsl' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/XSL/Transform', |
|
| 794 | - 'smf' => 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/profile', |
|
| 795 | - 'html' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/xhtml', |
|
| 793 | + 'xsl' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/XSL/Transform', |
|
| 794 | + 'smf' => 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/profile', |
|
| 795 | + 'html' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/xhtml', |
|
| 796 | 796 | ), |
| 797 | 797 | 'exclude-result-prefixes' => array('smf', 'html'), |
| 798 | 798 | 'output' => array( |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | $css_to_minify = array(); |
| 982 | 982 | $normal_css_files = array(); |
| 983 | 983 | |
| 984 | - usort($context['css_files'], function ($a, $b) |
|
| 984 | + usort($context['css_files'], function($a, $b) |
|
| 985 | 985 | { |
| 986 | 986 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
| 987 | 987 | }); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | // Set a list of common functions. |
| 105 | 105 | $ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);'; |
| 106 | 106 | $ent_check = empty($modSettings['disableEntityCheck']) ? function($string) |
| 107 | - { |
|
| 107 | + { |
|
| 108 | 108 | $string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string); |
| 109 | 109 | return $string; |
| 110 | 110 | } : function($string) |
@@ -929,7 +929,6 @@ discard block |
||
| 929 | 929 | $user_info_min[$row['id_member']]['time_offset'] = ($tz_user->getOffset($time_user) - |
| 930 | 930 | $tz_system->getOffset($time_system)) / 3600; |
| 931 | 931 | } |
| 932 | - |
|
| 933 | 932 | else |
| 934 | 933 | $user_info_min[$row['id_member']]['time_offset'] = empty($row['time_offset']) ? 0 : $row['time_offset']; |
| 935 | 934 | } |
@@ -1658,7 +1657,6 @@ discard block |
||
| 1658 | 1657 | $time_user = new DateTime('now', $tz_user); |
| 1659 | 1658 | $profile['time_offset'] = ($tz_user->getOffset($time_user) - $tz_system->getOffset($time_system)) / 3600; |
| 1660 | 1659 | } |
| 1661 | - |
|
| 1662 | 1660 | else |
| 1663 | 1661 | { |
| 1664 | 1662 | // !!! Compatibility. |
@@ -2321,7 +2319,6 @@ discard block |
||
| 2321 | 2319 | loadLanguage('index+Modifications'); |
| 2322 | 2320 | $context['template_layers'] = array(); |
| 2323 | 2321 | } |
| 2324 | - |
|
| 2325 | 2322 | else |
| 2326 | 2323 | { |
| 2327 | 2324 | // Custom templates to load, or just default? |
@@ -2702,14 +2699,12 @@ discard block |
||
| 2702 | 2699 | $fileUrl = $settings['default_theme_url'] . '/css/' . $fileName; |
| 2703 | 2700 | $filePath = $settings['default_theme_dir'] . '/css/' . $fileName; |
| 2704 | 2701 | } |
| 2705 | - |
|
| 2706 | 2702 | else |
| 2707 | 2703 | { |
| 2708 | 2704 | $fileUrl = false; |
| 2709 | 2705 | $filePath = false; |
| 2710 | 2706 | } |
| 2711 | 2707 | } |
| 2712 | - |
|
| 2713 | 2708 | else |
| 2714 | 2709 | { |
| 2715 | 2710 | $fileUrl = $settings[$themeRef . '_url'] . '/css/' . $fileName; |
@@ -2817,14 +2812,12 @@ discard block |
||
| 2817 | 2812 | $fileUrl = $settings['default_theme_url'] . '/scripts/' . $fileName; |
| 2818 | 2813 | $filePath = $settings['default_theme_dir'] . '/scripts/' . $fileName; |
| 2819 | 2814 | } |
| 2820 | - |
|
| 2821 | 2815 | else |
| 2822 | 2816 | { |
| 2823 | 2817 | $fileUrl = false; |
| 2824 | 2818 | $filePath = false; |
| 2825 | 2819 | } |
| 2826 | 2820 | } |
| 2827 | - |
|
| 2828 | 2821 | else |
| 2829 | 2822 | { |
| 2830 | 2823 | $fileUrl = $settings[$themeRef . '_url'] . '/scripts/' . $fileName; |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | $feed_meta = array( |
| 154 | 154 | 'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']), |
| 155 | - 'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))), |
|
| 155 | + 'desc' => sentence_list(array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))), |
|
| 156 | 156 | 'author' => $mbname, |
| 157 | 157 | 'source' => $scripturl . '?action=profile;u=' . $uid, |
| 158 | 158 | 'self' => '', // Unused, but can't be null. |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | 'src' => 'src="' . $currentAttachment['href'] . '" onerror="$(\'.dlattach_' . $currentAttachment['id'] . '\').show(); $(\'.dlattach_' . $currentAttachment['id'] . '\').css({\'position\': \'absolute\'});"', |
| 641 | 641 | ), |
| 642 | 642 | $returnContext |
| 643 | - ) . $hidden_orig_link . '</span>' ; |
|
| 643 | + ) . $hidden_orig_link . '</span>'; |
|
| 644 | 644 | } |
| 645 | 645 | elseif (strpos($currentAttachment['mime_type'], 'video/') === 0) |
| 646 | 646 | { |
@@ -152,7 +152,9 @@ |
||
| 152 | 152 | |
| 153 | 153 | $feed_meta = array( |
| 154 | 154 | 'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']), |
| 155 | - 'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))), |
|
| 155 | + 'desc' => sentence_list(array_map(function ($datatype) use ($txt) |
|
| 156 | + { |
|
| 157 | +return $txt[$datatype]; }, array_keys($included))), |
|
| 156 | 158 | 'author' => $mbname, |
| 157 | 159 | 'source' => $scripturl . '?action=profile;u=' . $uid, |
| 158 | 160 | 'self' => '', // Unused, but can't be null. |
@@ -393,17 +393,17 @@ discard block |
||
| 393 | 393 | $quickbuttons = array( |
| 394 | 394 | 'approve' => array( |
| 395 | 395 | 'label' => $txt['approve'], |
| 396 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';approve='.$item['id'], |
|
| 396 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=' . $context['current_view'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';approve=' . $item['id'], |
|
| 397 | 397 | 'icon' => 'approve', |
| 398 | 398 | ), |
| 399 | 399 | 'delete' => array( |
| 400 | 400 | 'label' => $txt['remove'], |
| 401 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';delete='.$item['id'], |
|
| 401 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=' . $context['current_view'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';delete=' . $item['id'], |
|
| 402 | 402 | 'icon' => 'remove_button', |
| 403 | 403 | 'show' => $item['can_delete'] |
| 404 | 404 | ), |
| 405 | 405 | 'quickmod' => array( |
| 406 | - 'content' => '<input type="checkbox" name="item[]" value="'.$item['id'].'" checked>', |
|
| 406 | + 'content' => '<input type="checkbox" name="item[]" value="' . $item['id'] . '" checked>', |
|
| 407 | 407 | 'show' => !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 |
| 408 | 408 | ), |
| 409 | 409 | ); |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | $quickbuttons = array( |
| 469 | 469 | 'delete' => array( |
| 470 | 470 | 'label' => $txt['remove_message'], |
| 471 | - 'href' => $scripturl.'?action=moderate;area=userwatch;sa=post;delete='.$post['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 471 | + 'href' => $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 472 | 472 | 'javascript' => 'data-confirm="' . $txt['mc_watched_users_delete_post'] . '"', |
| 473 | 473 | 'class' => 'you_sure', |
| 474 | 474 | 'icon' => 'remove_button', |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | AND a.is_read = 0' : '') . (!empty($alertIDs) ? ' |
| 262 | 262 | AND a.id_alert IN ({array_int:alertIDs})' : '') . ' |
| 263 | 263 | ORDER BY id_alert DESC' . (!empty($limit) ? ' |
| 264 | - LIMIT {int:limit}' : '') . (!empty($offset) ?' |
|
| 264 | + LIMIT {int:limit}' : '') . (!empty($offset) ? ' |
|
| 265 | 265 | OFFSET {int:offset}' : ''), |
| 266 | 266 | array( |
| 267 | 267 | 'id_member' => $memID, |
@@ -1160,20 +1160,20 @@ discard block |
||
| 1160 | 1160 | $context['posts'][$key]['quickbuttons'] = array( |
| 1161 | 1161 | 'reply' => array( |
| 1162 | 1162 | 'label' => $txt['reply'], |
| 1163 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'], |
|
| 1163 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'], |
|
| 1164 | 1164 | 'icon' => 'reply_button', |
| 1165 | 1165 | 'show' => $post['can_reply'] |
| 1166 | 1166 | ), |
| 1167 | 1167 | 'quote' => array( |
| 1168 | 1168 | 'label' => $txt['quote_action'], |
| 1169 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'].';quote='.$post['id'], |
|
| 1169 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'] . ';quote=' . $post['id'], |
|
| 1170 | 1170 | 'icon' => 'quote', |
| 1171 | 1171 | 'show' => $post['can_quote'] |
| 1172 | 1172 | ), |
| 1173 | 1173 | 'remove' => array( |
| 1174 | 1174 | 'label' => $txt['remove'], |
| 1175 | - 'href' => $scripturl.'?action=deletemsg;msg='.$post['id'].';topic='.$post['topic'].';profile;u='.$context['member']['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 1176 | - 'javascript' => 'data-confirm="'.$txt['remove_message'].'"', |
|
| 1175 | + 'href' => $scripturl . '?action=deletemsg;msg=' . $post['id'] . ';topic=' . $post['topic'] . ';profile;u=' . $context['member']['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 1176 | + 'javascript' => 'data-confirm="' . $txt['remove_message'] . '"', |
|
| 1177 | 1177 | 'class' => 'you_sure', |
| 1178 | 1178 | 'icon' => 'remove_button', |
| 1179 | 1179 | 'show' => $post['can_delete'] |