@@ -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 | /** |
@@ -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 | { |
@@ -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 | }); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $header .= '<xsl:stylesheet version="' . (!empty($context['xslt_settings']['version']) ? $context['xslt_settings']['version'] : '1.0') . '"'; |
| 69 | 69 | |
| 70 | 70 | // XSL's own namespace declaration is required no matter what. |
| 71 | - $context['xslt_settings']['namespaces']['xsl'] = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/XSL/Transform'; |
|
| 71 | + $context['xslt_settings']['namespaces']['xsl'] = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/XSL/Transform'; |
|
| 72 | 72 | |
| 73 | 73 | foreach ($context['xslt_settings']['namespaces'] as $ns_prefix => $ns_uri) |
| 74 | 74 | { |
@@ -1064,14 +1064,14 @@ discard block |
||
| 1064 | 1064 | |
| 1065 | 1065 | if (!empty($context['export_css_header'])) |
| 1066 | 1066 | { |
| 1067 | - $template .= ' |
|
| 1067 | + $template .= ' |
|
| 1068 | 1068 | <style><![CDATA[' . "\n" . implode("\n", $context['export_css_header']) . "\n" . ']]> |
| 1069 | 1069 | </style>'; |
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | 1072 | if (!empty($context['export_javascript_vars'])) |
| 1073 | 1073 | { |
| 1074 | - $template .= ' |
|
| 1074 | + $template .= ' |
|
| 1075 | 1075 | <script><![CDATA['; |
| 1076 | 1076 | |
| 1077 | 1077 | foreach ($context['export_javascript_vars'] as $var => $val) |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | |
| 1108 | 1108 | if (!empty($context['export_javascript_inline']['standard'])) |
| 1109 | 1109 | { |
| 1110 | - $template .= ' |
|
| 1110 | + $template .= ' |
|
| 1111 | 1111 | <script><![CDATA[' . "\n" . implode("\n", $context['export_javascript_inline']['standard']) . "\n" . ']]> |
| 1112 | 1112 | </script>'; |
| 1113 | 1113 | } |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | |
| 1120 | 1120 | $template .= "\n\t" . str_replace("\n", "\n\t", implode("\n", $context['export_javascript_inline']['defer'])); |
| 1121 | 1121 | |
| 1122 | - $template .= "\n" . '});'. "\n" . ']]> |
|
| 1122 | + $template .= "\n" . '});' . "\n" . ']]> |
|
| 1123 | 1123 | </script>'; |
| 1124 | 1124 | } |
| 1125 | 1125 | |