@@ -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))))); |
@@ -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,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. |
@@ -163,7 +163,8 @@ |
||
| 163 | 163 | else |
| 164 | 164 | $context['help_text'] = $_GET['help']; |
| 165 | 165 | |
| 166 | - switch ($_GET['help']) { |
|
| 166 | + switch ($_GET['help']) |
|
| 167 | + { |
|
| 167 | 168 | case 'cal_short_months': |
| 168 | 169 | $context['help_text'] = sprintf($context['help_text'], $txt['months_short'][1], $txt['months_titles'][1]); |
| 169 | 170 | break; |
@@ -893,7 +893,8 @@ discard block |
||
| 893 | 893 | if ($smcFunc['db_num_rows']($request) != 0) |
| 894 | 894 | $duplicateMail = true; |
| 895 | 895 | |
| 896 | - if (isset($duplicateName) || isset($duplicateMail)){ |
|
| 896 | + if (isset($duplicateName) || isset($duplicateMail)) |
|
| 897 | + { |
|
| 897 | 898 | global $db_prefix; |
| 898 | 899 | return throw_error(sprintf($txt['error_duplicate_members'], $db_prefix)); |
| 899 | 900 | } |
@@ -3377,7 +3378,9 @@ discard block |
||
| 3377 | 3378 | return $string; |
| 3378 | 3379 | |
| 3379 | 3380 | // This bit fixes incorrect string lengths, which can happen if the character encoding was changed (e.g. conversion to UTF-8) |
| 3380 | - $new_string = preg_replace_callback('~\bs:(\d+):"(.*?)";(?=$|[bidsa]:|[{}]|N;)~s', function ($matches) {return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";';}, $string); |
|
| 3381 | + $new_string = preg_replace_callback('~\bs:(\d+):"(.*?)";(?=$|[bidsa]:|[{}]|N;)~s', function ($matches) |
|
| 3382 | + { |
|
| 3383 | +return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";';}, $string); |
|
| 3381 | 3384 | |
| 3382 | 3385 | // @todo Add more possible fixes here. For example, fix incorrect array lengths, try to handle truncated strings gracefully, etc. |
| 3383 | 3386 | |