|
@@ -113,7 +113,7 @@ discard block |
|
|
block discarded – undo |
|
113
|
113
|
array_values(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES | ENT_HTML5)), |
|
114
|
114
|
)); |
|
115
|
115
|
|
|
116
|
|
- $ent_list = '&(?'.'>#(?'.'>\d+|x[0-9a-fA-F]+)|' . build_regex(array_map(function ($ent) { |
|
|
116
|
+ $ent_list = '&(?' . '>#(?' . '>\d+|x[0-9a-fA-F]+)|' . build_regex(array_map(function($ent) { |
|
117
|
117
|
return substr($ent, 1, -1); |
|
118
|
118
|
}, $named_entities), '~') . ');'; |
|
119
|
119
|
|
|
@@ -130,10 +130,10 @@ discard block |
|
|
block discarded – undo |
|
130
|
130
|
'htmltrim' => function($string) use ($utf8) |
|
131
|
131
|
{ |
|
132
|
132
|
// Find all possible versions of |
|
133
|
|
- $nbsp = '&(?'.'>nbsp|#(?'.'>x0*A0|0*160));'; |
|
|
133
|
+ $nbsp = '&(?' . '>nbsp|#(?' . '>x0*A0|0*160));'; |
|
134
|
134
|
|
|
135
|
135
|
// Interesting fact: Unicode properties work even when not in UTF-8 mode. |
|
136
|
|
- return preg_replace('~^(?'.'>[\p{Z}\p{C}]|' . $nbsp . ')+|(?'.'>[\p{Z}\p{C}]|' . $nbsp . ')+$~' . ($utf8 ? 'u' : ''), '', sanitize_entities($string)); |
|
|
136
|
+ return preg_replace('~^(?' . '>[\p{Z}\p{C}]|' . $nbsp . ')+|(?' . '>[\p{Z}\p{C}]|' . $nbsp . ')+$~' . ($utf8 ? 'u' : ''), '', sanitize_entities($string)); |
|
137
|
137
|
}, |
|
138
|
138
|
'strlen' => function($string) use ($ent_list, $utf8) |
|
139
|
139
|
{ |
|
@@ -777,7 +777,7 @@ discard block |
|
|
block discarded – undo |
|
777
|
777
|
'filename' => empty($user_settings['filename']) ? '' : $user_settings['filename'], |
|
778
|
778
|
'custom_dir' => !empty($user_settings['attachment_type']) && $user_settings['attachment_type'] == 1, |
|
779
|
779
|
'id_attach' => isset($user_settings['id_attach']) ? $user_settings['id_attach'] : 0, |
|
780
|
|
- 'width' => isset($user_settings['attachment_width']) > 0 ? $user_settings['attachment_width']: 0, |
|
|
780
|
+ 'width' => isset($user_settings['attachment_width']) > 0 ? $user_settings['attachment_width'] : 0, |
|
781
|
781
|
'height' => isset($user_settings['attachment_height']) > 0 ? $user_settings['attachment_height'] : 0, |
|
782
|
782
|
), |
|
783
|
783
|
'smiley_set' => isset($user_settings['smiley_set']) ? $user_settings['smiley_set'] : '', |
|
@@ -1725,7 +1725,7 @@ discard block |
|
|
block discarded – undo |
|
1725
|
1725
|
if (!empty($image)) |
|
1726
|
1726
|
$memberContext[$user]['avatar'] = array( |
|
1727
|
1727
|
'name' => $profile['avatar'], |
|
1728
|
|
- 'image' => '<img class="avatar" src="' . $image . '" alt="" loading="lazy" width="' . $profile['attachment_width'] . '" height = "'. $profile['attachment_height'] . '">', |
|
|
1728
|
+ 'image' => '<img class="avatar" src="' . $image . '" alt="" loading="lazy" width="' . $profile['attachment_width'] . '" height = "' . $profile['attachment_height'] . '">', |
|
1729
|
1729
|
'href' => $image, |
|
1730
|
1730
|
'url' => $image, |
|
1731
|
1731
|
); |
|
@@ -2690,8 +2690,7 @@ discard block |
|
|
block discarded – undo |
|
2690
|
2690
|
$context['css_files_order'] = array(); |
|
2691
|
2691
|
|
|
2692
|
2692
|
$params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
|
2693
|
|
- (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
2694
|
|
- (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
|
2693
|
+ (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2695
|
2694
|
$params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
|
2696
|
2695
|
$themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
|
2697
|
2696
|
$params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true; |
|
@@ -2805,8 +2804,7 @@ discard block |
|
|
block discarded – undo |
|
2805
|
2804
|
global $settings, $context, $modSettings; |
|
2806
|
2805
|
|
|
2807
|
2806
|
$params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
|
2808
|
|
- (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
2809
|
|
- (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
|
2807
|
+ (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2810
|
2808
|
$params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
|
2811
|
2809
|
$themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
|
2812
|
2810
|
$params['async'] = isset($params['async']) ? $params['async'] : false; |
|
@@ -3549,8 +3547,7 @@ discard block |
|
|
block discarded – undo |
|
3549
|
3547
|
|
|
3550
|
3548
|
// What accelerator we are going to try. |
|
3551
|
3549
|
$cache_class_name = !empty($cache_accelerator) ? $cache_accelerator : CacheApi::APIS_DEFAULT; |
|
3552
|
|
- $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : |
|
3553
|
|
- CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
|
3550
|
+ $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
3554
|
3551
|
|
|
3555
|
3552
|
// Do some basic tests. |
|
3556
|
3553
|
if (class_exists($fully_qualified_class_name)) |
|
@@ -3854,7 +3851,7 @@ discard block |
|
|
block discarded – undo |
|
3854
|
3851
|
$auth_secret = hash_file('sha256', $boarddir . '/Settings.php'); |
|
3855
|
3852
|
|
|
3856
|
3853
|
// Set the last error to now, but only every 15 minutes. Don't need to flood the logs. |
|
3857
|
|
- if (empty($db_last_error) || ($db_last_error + 60*15) <= time()) |
|
|
3854
|
+ if (empty($db_last_error) || ($db_last_error + 60 * 15) <= time()) |
|
3858
|
3855
|
{ |
|
3859
|
3856
|
updateDbLastError(time()); |
|
3860
|
3857
|
loadLanguage('Errors'); |