@@ -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 | /** |
@@ -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; |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | |
460 | 460 | // Figure out the filename we'll tell the browser. |
461 | 461 | $datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile'); |
462 | - $included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
462 | + $included_desc = array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
463 | 463 | |
464 | 464 | $dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc); |
465 | 465 | $dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename))))); |
@@ -774,9 +774,9 @@ discard block |
||
774 | 774 | $xslt_variables = array(); |
775 | 775 | |
776 | 776 | // Do not change any of these to HTTPS URLs. For explanation, see comments in the buildXmlFeed() function. |
777 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/profile'; |
|
778 | - $xslt_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/XSL/Transform'; |
|
779 | - $html_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/xhtml'; |
|
777 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/profile'; |
|
778 | + $xslt_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/XSL/Transform'; |
|
779 | + $html_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/xhtml'; |
|
780 | 780 | |
781 | 781 | require_once($sourcedir . DIRECTORY_SEPARATOR . 'News.php'); |
782 | 782 | |
@@ -1682,14 +1682,14 @@ discard block |
||
1682 | 1682 | |
1683 | 1683 | if (!empty($context['export_css_header'])) |
1684 | 1684 | { |
1685 | - $stylesheet['css_js'] .= ' |
|
1685 | + $stylesheet['css_js'] .= ' |
|
1686 | 1686 | <style><![CDATA[' . "\n" . implode("\n", $context['export_css_header']) . "\n" . ']]> |
1687 | 1687 | </style>'; |
1688 | 1688 | } |
1689 | 1689 | |
1690 | 1690 | if (!empty($context['export_javascript_vars'])) |
1691 | 1691 | { |
1692 | - $stylesheet['css_js'] .= ' |
|
1692 | + $stylesheet['css_js'] .= ' |
|
1693 | 1693 | <script><![CDATA['; |
1694 | 1694 | |
1695 | 1695 | foreach ($context['export_javascript_vars'] as $var => $val) |
@@ -1725,7 +1725,7 @@ discard block |
||
1725 | 1725 | |
1726 | 1726 | if (!empty($context['export_javascript_inline']['standard'])) |
1727 | 1727 | { |
1728 | - $stylesheet['css_js'] .= ' |
|
1728 | + $stylesheet['css_js'] .= ' |
|
1729 | 1729 | <script><![CDATA[' . "\n" . implode("\n", $context['export_javascript_inline']['standard']) . "\n" . ']]> |
1730 | 1730 | </script>'; |
1731 | 1731 | } |
@@ -1737,7 +1737,7 @@ discard block |
||
1737 | 1737 | |
1738 | 1738 | $stylesheet['css_js'] .= "\n\t" . str_replace("\n", "\n\t", implode("\n", $context['export_javascript_inline']['defer'])); |
1739 | 1739 | |
1740 | - $stylesheet['css_js'] .= "\n" . '});'. "\n" . ']]> |
|
1740 | + $stylesheet['css_js'] .= "\n" . '});' . "\n" . ']]> |
|
1741 | 1741 | </script>'; |
1742 | 1742 | } |
1743 | 1743 | |
@@ -1818,7 +1818,7 @@ discard block |
||
1818 | 1818 | $css_to_minify = array(); |
1819 | 1819 | $normal_css_files = array(); |
1820 | 1820 | |
1821 | - usort($context['css_files'], function ($a, $b) |
|
1821 | + usort($context['css_files'], function($a, $b) |
|
1822 | 1822 | { |
1823 | 1823 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
1824 | 1824 | }); |
@@ -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. |