@@ -425,7 +425,8 @@ discard block |
||
425 | 425 | if (!empty($day['events'])) |
426 | 426 | { |
427 | 427 | // Sort events by start time (all day events will be listed first) |
428 | - uasort($day['events'], function($a, $b) { |
|
428 | + uasort($day['events'], function($a, $b) |
|
429 | + { |
|
429 | 430 | if ($a['start_timestamp'] == $b['start_timestamp']) |
430 | 431 | return 0; |
431 | 432 | |
@@ -619,7 +620,8 @@ discard block |
||
619 | 620 | if (!empty($day['events'])) |
620 | 621 | { |
621 | 622 | // Sort events by start time (all day events will be listed first) |
622 | - uasort($day['events'], function($a, $b) { |
|
623 | + uasort($day['events'], function($a, $b) |
|
624 | + { |
|
623 | 625 | if ($a['start_timestamp'] == $b['start_timestamp']) |
624 | 626 | return 0; |
625 | 627 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
@@ -332,7 +332,6 @@ discard block |
||
332 | 332 | $replacement .= $precedingStyle . $extra_attr . $afterStyle; |
333 | 333 | } |
334 | 334 | } |
335 | - |
|
336 | 335 | elseif (preg_match('~</([A-Za-z]+)>~', $part, $matches) === 1) |
337 | 336 | { |
338 | 337 | // Is this the element that we've been waiting for to be closed? |
@@ -592,7 +591,6 @@ discard block |
||
592 | 591 | $parts[$i + 2] = str_repeat("\t", $listDepth) . '[/list]'; |
593 | 592 | $parts[$i + 3] = ''; |
594 | 593 | } |
595 | - |
|
596 | 594 | else |
597 | 595 | { |
598 | 596 | // We're in a list item. |
@@ -631,7 +629,6 @@ discard block |
||
631 | 629 | $parts[$i + 2] = ''; |
632 | 630 | $parts[$i + 3] = ''; |
633 | 631 | } |
634 | - |
|
635 | 632 | else |
636 | 633 | { |
637 | 634 | // Remove the trailing breaks from the list item. |
@@ -94,7 +94,8 @@ discard block |
||
94 | 94 | { |
95 | 95 | $input = mb_strtolower($input, $this->encoding); |
96 | 96 | $parts = explode('.', $input); |
97 | - foreach ($parts as &$part) { |
|
97 | + foreach ($parts as &$part) |
|
98 | + { |
|
98 | 99 | $part = $this->encodePart($part); |
99 | 100 | } |
100 | 101 | $output = implode('.', $parts); |
@@ -119,13 +120,16 @@ discard block |
||
119 | 120 | $h = $b = count($codePoints['basic']); |
120 | 121 | |
121 | 122 | $output = ''; |
122 | - foreach ($codePoints['basic'] as $code) { |
|
123 | + foreach ($codePoints['basic'] as $code) |
|
124 | + { |
|
123 | 125 | $output .= $this->codePointToChar($code); |
124 | 126 | } |
125 | - if ($input === $output) { |
|
127 | + if ($input === $output) |
|
128 | + { |
|
126 | 129 | return $output; |
127 | 130 | } |
128 | - if ($b > 0) { |
|
131 | + if ($b > 0) |
|
132 | + { |
|
129 | 133 | $output .= static::DELIMITER; |
130 | 134 | } |
131 | 135 | |
@@ -134,20 +138,26 @@ discard block |
||
134 | 138 | |
135 | 139 | $i = 0; |
136 | 140 | $length = mb_strlen($input, $this->encoding); |
137 | - while ($h < $length) { |
|
141 | + while ($h < $length) |
|
142 | + { |
|
138 | 143 | $m = $codePoints['nonBasic'][$i++]; |
139 | 144 | $delta = $delta + ($m - $n) * ($h + 1); |
140 | 145 | $n = $m; |
141 | 146 | |
142 | - foreach ($codePoints['all'] as $c) { |
|
143 | - if ($c < $n || $c < static::INITIAL_N) { |
|
147 | + foreach ($codePoints['all'] as $c) |
|
148 | + { |
|
149 | + if ($c < $n || $c < static::INITIAL_N) |
|
150 | + { |
|
144 | 151 | $delta++; |
145 | 152 | } |
146 | - if ($c === $n) { |
|
153 | + if ($c === $n) |
|
154 | + { |
|
147 | 155 | $q = $delta; |
148 | - for ($k = static::BASE;; $k += static::BASE) { |
|
156 | + for ($k = static::BASE;; $k += static::BASE) |
|
157 | + { |
|
149 | 158 | $t = $this->calculateThreshold($k, $bias); |
150 | - if ($q < $t) { |
|
159 | + if ($q < $t) |
|
160 | + { |
|
151 | 161 | break; |
152 | 162 | } |
153 | 163 |
@@ -742,7 +742,7 @@ |
||
742 | 742 | |
743 | 743 | // Filter out any redundant separators before we start the loop |
744 | 744 | $context['config_vars'] = array_filter($context['config_vars'], function ($v) use ($context) |
745 | - { |
|
745 | + { |
|
746 | 746 | static $config_vars, $prev; |
747 | 747 | |
748 | 748 | $at_start = is_null($config_vars); |
@@ -1965,7 +1965,9 @@ |
||
1965 | 1965 | // Remove anything that isn't actually new from our list of files |
1966 | 1966 | foreach ($to_unset as $key => $ids) |
1967 | 1967 | { |
1968 | - if (array_reduce($ids, function ($carry, $item) { return $carry * $item; }, true) == true) |
|
1968 | + if (array_reduce($ids, function ($carry, $item) |
|
1969 | + { |
|
1970 | +return $carry * $item; }, true) == true) |
|
1969 | 1971 | unset($smiley_files[$key]); |
1970 | 1972 | } |
1971 | 1973 |
@@ -1254,7 +1254,6 @@ |
||
1254 | 1254 | |
1255 | 1255 | return array($charset, $string, 'base64'); |
1256 | 1256 | } |
1257 | - |
|
1258 | 1257 | else |
1259 | 1258 | return array($charset, $string, '7bit'); |
1260 | 1259 | } |
@@ -3205,7 +3205,9 @@ |
||
3205 | 3205 | return $string; |
3206 | 3206 | |
3207 | 3207 | // This bit fixes incorrect string lengths, which can happen if the character encoding was changed (e.g. conversion to UTF-8) |
3208 | - $new_string = preg_replace_callback('~\bs:(\d+):"(.*?)";(?=$|[bidsa]:|[{}]|N;)~s', function ($matches) {return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";';}, $string); |
|
3208 | + $new_string = preg_replace_callback('~\bs:(\d+):"(.*?)";(?=$|[bidsa]:|[{}]|N;)~s', function ($matches) |
|
3209 | + { |
|
3210 | +return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";';}, $string); |
|
3209 | 3211 | |
3210 | 3212 | // @todo Add more possible fixes here. For example, fix incorrect array lengths, try to handle truncated strings gracefully, etc. |
3211 | 3213 |
@@ -1824,7 +1824,7 @@ |
||
1824 | 1824 | { |
1825 | 1825 | // Make sure this is an array of integers |
1826 | 1826 | $excluded_groups = array_filter((array) $excluded_groups, function ($v) |
1827 | - { |
|
1827 | + { |
|
1828 | 1828 | return is_int($v) || is_string($v) && (string) intval($v) === $v; |
1829 | 1829 | }); |
1830 | 1830 |
@@ -100,18 +100,22 @@ |
||
100 | 100 | $tempTab++; |
101 | 101 | $context['tabindex'] = $tempTab; |
102 | 102 | |
103 | - foreach ($context['richedit_buttons'] as $name => $button) { |
|
104 | - if ($name == 'spell_check') { |
|
103 | + foreach ($context['richedit_buttons'] as $name => $button) |
|
104 | + { |
|
105 | + if ($name == 'spell_check') |
|
106 | + { |
|
105 | 107 | $button['onclick'] = 'oEditorHandle_' . $editor_id . '.spellCheckStart();'; |
106 | 108 | } |
107 | 109 | |
108 | - if ($name == 'preview') { |
|
110 | + if ($name == 'preview') |
|
111 | + { |
|
109 | 112 | $button['value'] = isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $button['value']; |
110 | 113 | $button['onclick'] = $editor_context['preview_type'] == 2 ? '' : 'return submitThisOnce(this);'; |
111 | 114 | $button['show'] = $editor_context['preview_type']; |
112 | 115 | } |
113 | 116 | |
114 | - if ($button['show']) { |
|
117 | + if ($button['show']) |
|
118 | + { |
|
115 | 119 | echo ' |
116 | 120 | <input type="', $button['type'], '"', $button['type'] == 'hidden' ? ' id="' . $name . '"' : '', ' name="', $name, '" value="', $button['value'], '"', $button['type'] != 'hidden' ? ' tabindex="' . --$tempTab . '"' : '', !empty($button['onclick']) ? ' onclick="' . $button['onclick'] . '"' : '', !empty($button['accessKey']) ? ' accesskey="' . $button['accessKey'] . '"' : '', $button['type'] != 'hidden' ? ' class="button"' : '', '>'; |
117 | 121 | } |