@@ -27,164 +27,164 @@ |
||
27 | 27 | */ |
28 | 28 | |
29 | 29 | if (!defined('RANDOM_COMPAT_READ_BUFFER')) { |
30 | - define('RANDOM_COMPAT_READ_BUFFER', 8); |
|
30 | + define('RANDOM_COMPAT_READ_BUFFER', 8); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | if (!is_callable('random_bytes')) { |
34 | - /** |
|
35 | - * Unless open_basedir is enabled, use /dev/urandom for |
|
36 | - * random numbers in accordance with best practices |
|
37 | - * |
|
38 | - * Why we use /dev/urandom and not /dev/random |
|
39 | - * @ref https://www.2uo.de/myths-about-urandom |
|
40 | - * @ref http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers |
|
41 | - * |
|
42 | - * @param int $bytes |
|
43 | - * |
|
44 | - * @throws Exception |
|
45 | - * |
|
46 | - * @return string |
|
47 | - */ |
|
48 | - function random_bytes($bytes) |
|
49 | - { |
|
50 | - /** @var resource $fp */ |
|
51 | - static $fp = null; |
|
34 | + /** |
|
35 | + * Unless open_basedir is enabled, use /dev/urandom for |
|
36 | + * random numbers in accordance with best practices |
|
37 | + * |
|
38 | + * Why we use /dev/urandom and not /dev/random |
|
39 | + * @ref https://www.2uo.de/myths-about-urandom |
|
40 | + * @ref http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers |
|
41 | + * |
|
42 | + * @param int $bytes |
|
43 | + * |
|
44 | + * @throws Exception |
|
45 | + * |
|
46 | + * @return string |
|
47 | + */ |
|
48 | + function random_bytes($bytes) |
|
49 | + { |
|
50 | + /** @var resource $fp */ |
|
51 | + static $fp = null; |
|
52 | 52 | |
53 | - /** |
|
54 | - * This block should only be run once |
|
55 | - */ |
|
56 | - if (empty($fp)) { |
|
57 | - /** |
|
58 | - * We don't want to ever read C:\dev\random, only /dev/urandom on |
|
59 | - * Unix-like operating systems. While we guard against this |
|
60 | - * condition in random.php, it doesn't hurt to be defensive in depth |
|
61 | - * here. |
|
62 | - * |
|
63 | - * To that end, we only try to open /dev/urandom if we're on a Unix- |
|
64 | - * like operating system (which means the directory separator is set |
|
65 | - * to "/" not "\". |
|
66 | - */ |
|
67 | - if (DIRECTORY_SEPARATOR === '/') { |
|
68 | - if (!is_readable('/dev/urandom')) { |
|
69 | - throw new Exception( |
|
70 | - 'Environment misconfiguration: ' . |
|
71 | - '/dev/urandom cannot be read.' |
|
72 | - ); |
|
73 | - } |
|
74 | - /** |
|
75 | - * We use /dev/urandom if it is a char device. |
|
76 | - * We never fall back to /dev/random |
|
77 | - */ |
|
78 | - /** @var resource|bool $fp */ |
|
79 | - $fp = fopen('/dev/urandom', 'rb'); |
|
80 | - if (is_resource($fp)) { |
|
81 | - /** @var array<string, int> $st */ |
|
82 | - $st = fstat($fp); |
|
83 | - if (($st['mode'] & 0170000) !== 020000) { |
|
84 | - fclose($fp); |
|
85 | - $fp = false; |
|
86 | - } |
|
87 | - } |
|
88 | - } |
|
53 | + /** |
|
54 | + * This block should only be run once |
|
55 | + */ |
|
56 | + if (empty($fp)) { |
|
57 | + /** |
|
58 | + * We don't want to ever read C:\dev\random, only /dev/urandom on |
|
59 | + * Unix-like operating systems. While we guard against this |
|
60 | + * condition in random.php, it doesn't hurt to be defensive in depth |
|
61 | + * here. |
|
62 | + * |
|
63 | + * To that end, we only try to open /dev/urandom if we're on a Unix- |
|
64 | + * like operating system (which means the directory separator is set |
|
65 | + * to "/" not "\". |
|
66 | + */ |
|
67 | + if (DIRECTORY_SEPARATOR === '/') { |
|
68 | + if (!is_readable('/dev/urandom')) { |
|
69 | + throw new Exception( |
|
70 | + 'Environment misconfiguration: ' . |
|
71 | + '/dev/urandom cannot be read.' |
|
72 | + ); |
|
73 | + } |
|
74 | + /** |
|
75 | + * We use /dev/urandom if it is a char device. |
|
76 | + * We never fall back to /dev/random |
|
77 | + */ |
|
78 | + /** @var resource|bool $fp */ |
|
79 | + $fp = fopen('/dev/urandom', 'rb'); |
|
80 | + if (is_resource($fp)) { |
|
81 | + /** @var array<string, int> $st */ |
|
82 | + $st = fstat($fp); |
|
83 | + if (($st['mode'] & 0170000) !== 020000) { |
|
84 | + fclose($fp); |
|
85 | + $fp = false; |
|
86 | + } |
|
87 | + } |
|
88 | + } |
|
89 | 89 | |
90 | - if (is_resource($fp)) { |
|
91 | - /** |
|
92 | - * stream_set_read_buffer() does not exist in HHVM |
|
93 | - * |
|
94 | - * If we don't set the stream's read buffer to 0, PHP will |
|
95 | - * internally buffer 8192 bytes, which can waste entropy |
|
96 | - * |
|
97 | - * stream_set_read_buffer returns 0 on success |
|
98 | - */ |
|
99 | - if (is_callable('stream_set_read_buffer')) { |
|
100 | - stream_set_read_buffer($fp, RANDOM_COMPAT_READ_BUFFER); |
|
101 | - } |
|
102 | - if (is_callable('stream_set_chunk_size')) { |
|
103 | - stream_set_chunk_size($fp, RANDOM_COMPAT_READ_BUFFER); |
|
104 | - } |
|
105 | - } |
|
106 | - } |
|
90 | + if (is_resource($fp)) { |
|
91 | + /** |
|
92 | + * stream_set_read_buffer() does not exist in HHVM |
|
93 | + * |
|
94 | + * If we don't set the stream's read buffer to 0, PHP will |
|
95 | + * internally buffer 8192 bytes, which can waste entropy |
|
96 | + * |
|
97 | + * stream_set_read_buffer returns 0 on success |
|
98 | + */ |
|
99 | + if (is_callable('stream_set_read_buffer')) { |
|
100 | + stream_set_read_buffer($fp, RANDOM_COMPAT_READ_BUFFER); |
|
101 | + } |
|
102 | + if (is_callable('stream_set_chunk_size')) { |
|
103 | + stream_set_chunk_size($fp, RANDOM_COMPAT_READ_BUFFER); |
|
104 | + } |
|
105 | + } |
|
106 | + } |
|
107 | 107 | |
108 | - try { |
|
109 | - /** @var int $bytes */ |
|
110 | - $bytes = RandomCompat_intval($bytes); |
|
111 | - } catch (TypeError $ex) { |
|
112 | - throw new TypeError( |
|
113 | - 'random_bytes(): $bytes must be an integer' |
|
114 | - ); |
|
115 | - } |
|
108 | + try { |
|
109 | + /** @var int $bytes */ |
|
110 | + $bytes = RandomCompat_intval($bytes); |
|
111 | + } catch (TypeError $ex) { |
|
112 | + throw new TypeError( |
|
113 | + 'random_bytes(): $bytes must be an integer' |
|
114 | + ); |
|
115 | + } |
|
116 | 116 | |
117 | - if ($bytes < 1) { |
|
118 | - throw new Error( |
|
119 | - 'Length must be greater than 0' |
|
120 | - ); |
|
121 | - } |
|
117 | + if ($bytes < 1) { |
|
118 | + throw new Error( |
|
119 | + 'Length must be greater than 0' |
|
120 | + ); |
|
121 | + } |
|
122 | 122 | |
123 | - /** |
|
124 | - * This if() block only runs if we managed to open a file handle |
|
125 | - * |
|
126 | - * It does not belong in an else {} block, because the above |
|
127 | - * if (empty($fp)) line is logic that should only be run once per |
|
128 | - * page load. |
|
129 | - */ |
|
130 | - if (is_resource($fp)) { |
|
131 | - /** |
|
132 | - * @var int |
|
133 | - */ |
|
134 | - $remaining = $bytes; |
|
123 | + /** |
|
124 | + * This if() block only runs if we managed to open a file handle |
|
125 | + * |
|
126 | + * It does not belong in an else {} block, because the above |
|
127 | + * if (empty($fp)) line is logic that should only be run once per |
|
128 | + * page load. |
|
129 | + */ |
|
130 | + if (is_resource($fp)) { |
|
131 | + /** |
|
132 | + * @var int |
|
133 | + */ |
|
134 | + $remaining = $bytes; |
|
135 | 135 | |
136 | - /** |
|
137 | - * @var string|bool |
|
138 | - */ |
|
139 | - $buf = ''; |
|
136 | + /** |
|
137 | + * @var string|bool |
|
138 | + */ |
|
139 | + $buf = ''; |
|
140 | 140 | |
141 | - /** |
|
142 | - * We use fread() in a loop to protect against partial reads |
|
143 | - */ |
|
144 | - do { |
|
145 | - /** |
|
146 | - * @var string|bool |
|
147 | - */ |
|
148 | - $read = fread($fp, $remaining); |
|
149 | - if (!is_string($read)) { |
|
150 | - /** |
|
151 | - * We cannot safely read from the file. Exit the |
|
152 | - * do-while loop and trigger the exception condition |
|
153 | - * |
|
154 | - * @var string|bool |
|
155 | - */ |
|
156 | - $buf = false; |
|
157 | - break; |
|
158 | - } |
|
159 | - /** |
|
160 | - * Decrease the number of bytes returned from remaining |
|
161 | - */ |
|
162 | - $remaining -= RandomCompat_strlen($read); |
|
163 | - /** |
|
164 | - * @var string $buf |
|
165 | - */ |
|
166 | - $buf .= $read; |
|
167 | - } while ($remaining > 0); |
|
141 | + /** |
|
142 | + * We use fread() in a loop to protect against partial reads |
|
143 | + */ |
|
144 | + do { |
|
145 | + /** |
|
146 | + * @var string|bool |
|
147 | + */ |
|
148 | + $read = fread($fp, $remaining); |
|
149 | + if (!is_string($read)) { |
|
150 | + /** |
|
151 | + * We cannot safely read from the file. Exit the |
|
152 | + * do-while loop and trigger the exception condition |
|
153 | + * |
|
154 | + * @var string|bool |
|
155 | + */ |
|
156 | + $buf = false; |
|
157 | + break; |
|
158 | + } |
|
159 | + /** |
|
160 | + * Decrease the number of bytes returned from remaining |
|
161 | + */ |
|
162 | + $remaining -= RandomCompat_strlen($read); |
|
163 | + /** |
|
164 | + * @var string $buf |
|
165 | + */ |
|
166 | + $buf .= $read; |
|
167 | + } while ($remaining > 0); |
|
168 | 168 | |
169 | - /** |
|
170 | - * Is our result valid? |
|
171 | - * @var string|bool $buf |
|
172 | - */ |
|
173 | - if (is_string($buf)) { |
|
174 | - if (RandomCompat_strlen($buf) === $bytes) { |
|
175 | - /** |
|
176 | - * Return our random entropy buffer here: |
|
177 | - */ |
|
178 | - return $buf; |
|
179 | - } |
|
180 | - } |
|
181 | - } |
|
169 | + /** |
|
170 | + * Is our result valid? |
|
171 | + * @var string|bool $buf |
|
172 | + */ |
|
173 | + if (is_string($buf)) { |
|
174 | + if (RandomCompat_strlen($buf) === $bytes) { |
|
175 | + /** |
|
176 | + * Return our random entropy buffer here: |
|
177 | + */ |
|
178 | + return $buf; |
|
179 | + } |
|
180 | + } |
|
181 | + } |
|
182 | 182 | |
183 | - /** |
|
184 | - * If we reach here, PHP has failed us. |
|
185 | - */ |
|
186 | - throw new Exception( |
|
187 | - 'Error reading from source device' |
|
188 | - ); |
|
189 | - } |
|
183 | + /** |
|
184 | + * If we reach here, PHP has failed us. |
|
185 | + */ |
|
186 | + throw new Exception( |
|
187 | + 'Error reading from source device' |
|
188 | + ); |
|
189 | + } |
|
190 | 190 | } |
@@ -26,11 +26,13 @@ discard block |
||
26 | 26 | * SOFTWARE. |
27 | 27 | */ |
28 | 28 | |
29 | -if (!defined('RANDOM_COMPAT_READ_BUFFER')) { |
|
29 | +if (!defined('RANDOM_COMPAT_READ_BUFFER')) |
|
30 | +{ |
|
30 | 31 | define('RANDOM_COMPAT_READ_BUFFER', 8); |
31 | 32 | } |
32 | 33 | |
33 | -if (!is_callable('random_bytes')) { |
|
34 | +if (!is_callable('random_bytes')) |
|
35 | +{ |
|
34 | 36 | /** |
35 | 37 | * Unless open_basedir is enabled, use /dev/urandom for |
36 | 38 | * random numbers in accordance with best practices |
@@ -53,7 +55,8 @@ discard block |
||
53 | 55 | /** |
54 | 56 | * This block should only be run once |
55 | 57 | */ |
56 | - if (empty($fp)) { |
|
58 | + if (empty($fp)) |
|
59 | + { |
|
57 | 60 | /** |
58 | 61 | * We don't want to ever read C:\dev\random, only /dev/urandom on |
59 | 62 | * Unix-like operating systems. While we guard against this |
@@ -64,8 +67,10 @@ discard block |
||
64 | 67 | * like operating system (which means the directory separator is set |
65 | 68 | * to "/" not "\". |
66 | 69 | */ |
67 | - if (DIRECTORY_SEPARATOR === '/') { |
|
68 | - if (!is_readable('/dev/urandom')) { |
|
70 | + if (DIRECTORY_SEPARATOR === '/') |
|
71 | + { |
|
72 | + if (!is_readable('/dev/urandom')) |
|
73 | + { |
|
69 | 74 | throw new Exception( |
70 | 75 | 'Environment misconfiguration: ' . |
71 | 76 | '/dev/urandom cannot be read.' |
@@ -77,17 +82,20 @@ discard block |
||
77 | 82 | */ |
78 | 83 | /** @var resource|bool $fp */ |
79 | 84 | $fp = fopen('/dev/urandom', 'rb'); |
80 | - if (is_resource($fp)) { |
|
85 | + if (is_resource($fp)) |
|
86 | + { |
|
81 | 87 | /** @var array<string, int> $st */ |
82 | 88 | $st = fstat($fp); |
83 | - if (($st['mode'] & 0170000) !== 020000) { |
|
89 | + if (($st['mode'] & 0170000) !== 020000) |
|
90 | + { |
|
84 | 91 | fclose($fp); |
85 | 92 | $fp = false; |
86 | 93 | } |
87 | 94 | } |
88 | 95 | } |
89 | 96 | |
90 | - if (is_resource($fp)) { |
|
97 | + if (is_resource($fp)) |
|
98 | + { |
|
91 | 99 | /** |
92 | 100 | * stream_set_read_buffer() does not exist in HHVM |
93 | 101 | * |
@@ -96,25 +104,31 @@ discard block |
||
96 | 104 | * |
97 | 105 | * stream_set_read_buffer returns 0 on success |
98 | 106 | */ |
99 | - if (is_callable('stream_set_read_buffer')) { |
|
107 | + if (is_callable('stream_set_read_buffer')) |
|
108 | + { |
|
100 | 109 | stream_set_read_buffer($fp, RANDOM_COMPAT_READ_BUFFER); |
101 | 110 | } |
102 | - if (is_callable('stream_set_chunk_size')) { |
|
111 | + if (is_callable('stream_set_chunk_size')) |
|
112 | + { |
|
103 | 113 | stream_set_chunk_size($fp, RANDOM_COMPAT_READ_BUFFER); |
104 | 114 | } |
105 | 115 | } |
106 | 116 | } |
107 | 117 | |
108 | - try { |
|
118 | + try |
|
119 | + { |
|
109 | 120 | /** @var int $bytes */ |
110 | 121 | $bytes = RandomCompat_intval($bytes); |
111 | - } catch (TypeError $ex) { |
|
122 | + } |
|
123 | + catch (TypeError $ex) |
|
124 | + { |
|
112 | 125 | throw new TypeError( |
113 | 126 | 'random_bytes(): $bytes must be an integer' |
114 | 127 | ); |
115 | 128 | } |
116 | 129 | |
117 | - if ($bytes < 1) { |
|
130 | + if ($bytes < 1) |
|
131 | + { |
|
118 | 132 | throw new Error( |
119 | 133 | 'Length must be greater than 0' |
120 | 134 | ); |
@@ -127,7 +141,8 @@ discard block |
||
127 | 141 | * if (empty($fp)) line is logic that should only be run once per |
128 | 142 | * page load. |
129 | 143 | */ |
130 | - if (is_resource($fp)) { |
|
144 | + if (is_resource($fp)) |
|
145 | + { |
|
131 | 146 | /** |
132 | 147 | * @var int |
133 | 148 | */ |
@@ -146,7 +161,8 @@ discard block |
||
146 | 161 | * @var string|bool |
147 | 162 | */ |
148 | 163 | $read = fread($fp, $remaining); |
149 | - if (!is_string($read)) { |
|
164 | + if (!is_string($read)) |
|
165 | + { |
|
150 | 166 | /** |
151 | 167 | * We cannot safely read from the file. Exit the |
152 | 168 | * do-while loop and trigger the exception condition |
@@ -170,8 +186,10 @@ discard block |
||
170 | 186 | * Is our result valid? |
171 | 187 | * @var string|bool $buf |
172 | 188 | */ |
173 | - if (is_string($buf)) { |
|
174 | - if (RandomCompat_strlen($buf) === $bytes) { |
|
189 | + if (is_string($buf)) |
|
190 | + { |
|
191 | + if (RandomCompat_strlen($buf) === $bytes) |
|
192 | + { |
|
175 | 193 | /** |
176 | 194 | * Return our random entropy buffer here: |
177 | 195 | */ |
@@ -280,7 +280,6 @@ discard block |
||
280 | 280 | $this_category[$row_board['id_board']]['board_class'] = 'on'; |
281 | 281 | $this_category[$row_board['id_board']]['board_tooltip'] = $txt['new_posts']; |
282 | 282 | } |
283 | - |
|
284 | 283 | else |
285 | 284 | { |
286 | 285 | $this_category[$row_board['id_board']]['board_tooltip'] = $txt['old_posts']; |
@@ -415,7 +414,6 @@ discard block |
||
415 | 414 | $this_last_post['href'] = $scripturl . '?topic=' . $row_board['id_topic'] . '.msg' . ($user_info['is_guest'] ? $row_board['id_msg'] : $row_board['new_from']) . (empty($row_board['is_read']) ? ';boardseen' : '') . '#new'; |
416 | 415 | $this_last_post['link'] = '<a href="' . $this_last_post['href'] . '" title="' . $row_board['subject'] . '">' . $row_board['short_subject'] . '</a>'; |
417 | 416 | } |
418 | - |
|
419 | 417 | else |
420 | 418 | { |
421 | 419 | $this_last_post['href'] = ''; |
@@ -510,8 +508,7 @@ discard block |
||
510 | 508 | $board['last_post']['last_post_message'] = sprintf($txt['last_post_message'], $board['last_post']['member']['link'], $board['last_post']['link'], $board['last_post']['time'] > 0 ? timeformat($board['last_post']['time']) : $txt['not_applicable']); |
511 | 509 | } |
512 | 510 | } |
513 | - |
|
514 | - else |
|
511 | + else |
|
515 | 512 | foreach ($this_category as &$board) |
516 | 513 | { |
517 | 514 | if (isset($boards_parsed_data_by_cat_id[$board['id_cat']][$board['id']])) |
@@ -195,8 +195,7 @@ |
||
195 | 195 | ); |
196 | 196 | |
197 | 197 | $categories[$row_board['id_cat']]['link'] = '<a id="c' . $row_board['id_cat'] . '"></a>' . (!$context['user']['is_guest'] ? |
198 | - '<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' : |
|
199 | - $row_board['cat_name']); |
|
198 | + '<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' : $row_board['cat_name']); |
|
200 | 199 | |
201 | 200 | } |
202 | 201 |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | |
852 | 852 | clean_cache('data'); |
853 | 853 | |
854 | - cache_put_data('parsed_boards_descriptions_'. $parsed_boards_cat_id, $already_parsed_boards, 864000); |
|
854 | + cache_put_data('parsed_boards_descriptions_' . $parsed_boards_cat_id, $already_parsed_boards, 864000); |
|
855 | 855 | |
856 | 856 | if (empty($boardOptions['dont_log'])) |
857 | 857 | logAction('edit_board', array('board' => $board_id), 'admin'); |
@@ -1579,7 +1579,7 @@ discard block |
||
1579 | 1579 | $context['description_allowed_tags'] |
1580 | 1580 | ); |
1581 | 1581 | |
1582 | - cache_put_data('parsed_boards_descriptions_'. $category_id, $already_parsed_boards, 864000); |
|
1582 | + cache_put_data('parsed_boards_descriptions_' . $category_id, $already_parsed_boards, 864000); |
|
1583 | 1583 | |
1584 | 1584 | return $already_parsed_boards; |
1585 | 1585 | } |
@@ -455,7 +455,7 @@ |
||
455 | 455 | |
456 | 456 | elseif ($context['uninstalling']) |
457 | 457 | echo ' |
458 | - ', $txt['package_uninstall_done'] .' <br> |
|
458 | + ', $txt['package_uninstall_done'] . ' <br> |
|
459 | 459 | ', '<a href="', $context['keep_url'], '" class="button">', $txt['package_keep'], '</a>', '<a href="', $context['remove_url'], '" class="button">', $txt['package_delete2'], '</a>'; |
460 | 460 | |
461 | 461 | elseif ($context['install_finished']) |
@@ -279,7 +279,6 @@ discard block |
||
279 | 279 | $condition = 'id_member IN ({array_int:members})'; |
280 | 280 | $parameters['members'] = $members; |
281 | 281 | } |
282 | - |
|
283 | 282 | elseif ($members === null) |
284 | 283 | $condition = '1=1'; |
285 | 284 | |
@@ -382,11 +381,9 @@ discard block |
||
382 | 381 | $val = $val . ' END'; |
383 | 382 | $type = 'raw'; |
384 | 383 | } |
385 | - |
|
386 | 384 | else |
387 | 385 | $val = alert_count($members, true); |
388 | 386 | } |
389 | - |
|
390 | 387 | elseif ($type == 'int' && ($val === '+' || $val === '-')) |
391 | 388 | { |
392 | 389 | $val = $var . ' ' . $val . ' 1'; |
@@ -2202,12 +2199,12 @@ discard block |
||
2202 | 2199 | 'tag' => 'cowsay', |
2203 | 2200 | 'parameters' => array( |
2204 | 2201 | 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
2205 | - { |
|
2202 | + { |
|
2206 | 2203 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2207 | 2204 | }, |
2208 | 2205 | ), |
2209 | 2206 | 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
2210 | - { |
|
2207 | + { |
|
2211 | 2208 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2212 | 2209 | }, |
2213 | 2210 | ), |
@@ -3314,7 +3311,7 @@ discard block |
||
3314 | 3311 | |
3315 | 3312 | // Replace away! |
3316 | 3313 | $message = preg_replace_callback($smileyPregSearch, function($matches) use ($smileyPregReplacements) |
3317 | - { |
|
3314 | + { |
|
3318 | 3315 | return $smileyPregReplacements[$matches[1]]; |
3319 | 3316 | }, $message); |
3320 | 3317 | } |
@@ -4112,7 +4109,6 @@ discard block |
||
4112 | 4109 | if (!isset($minSeed) && isset($js_file['options']['seed'])) |
4113 | 4110 | $minSeed = $js_file['options']['seed']; |
4114 | 4111 | } |
4115 | - |
|
4116 | 4112 | else |
4117 | 4113 | { |
4118 | 4114 | echo ' |
@@ -6029,7 +6025,8 @@ discard block |
||
6029 | 6025 | $zones[$tzkey]['tzid'] = $tzid; |
6030 | 6026 | $zones[$tzkey]['dst_type'] = count($tzinfo) > 1 ? 1 : ($tzinfo[0]['isdst'] ? 2 : 0); |
6031 | 6027 | |
6032 | - foreach ($tzinfo as $transition) { |
|
6028 | + foreach ($tzinfo as $transition) |
|
6029 | + { |
|
6033 | 6030 | $zones[$tzkey]['abbrs'][] = $transition['abbr']; |
6034 | 6031 | } |
6035 | 6032 | |
@@ -6114,7 +6111,8 @@ discard block |
||
6114 | 6111 | $desc = implode(', ', array_slice(array_unique($tzvalue['locations']), 0, 5)) . (count($tzvalue['locations']) > 5 ? ', ' . $txt['etc'] : ''); |
6115 | 6112 | |
6116 | 6113 | // We don't want abbreviations like '+03' or '-11'. |
6117 | - $abbrs = array_filter($tzvalue['abbrs'], function ($abbr) { |
|
6114 | + $abbrs = array_filter($tzvalue['abbrs'], function ($abbr) |
|
6115 | + { |
|
6118 | 6116 | return !strspn($abbr, '+-'); |
6119 | 6117 | }); |
6120 | 6118 | $abbrs = count($abbrs) == count($tzvalue['abbrs']) ? array_unique($abbrs) : array(); |
@@ -6462,7 +6460,6 @@ discard block |
||
6462 | 6460 | $isWritable = true; |
6463 | 6461 | break; |
6464 | 6462 | } |
6465 | - |
|
6466 | 6463 | else |
6467 | 6464 | @chmod($file, $val); |
6468 | 6465 | } |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | { |
378 | 378 | $val = 'CASE '; |
379 | 379 | foreach ($members as $k => $v) |
380 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' '; |
|
380 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' '; |
|
381 | 381 | |
382 | 382 | $val = $val . ' END'; |
383 | 383 | $type = 'raw'; |
@@ -1039,11 +1039,11 @@ discard block |
||
1039 | 1039 | // Anything that isn't a specification, punctuation mark, or whitespace. |
1040 | 1040 | '~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
1041 | 1041 | // A series of punctuation marks (except %), possibly separated by whitespace. |
1042 | - '~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1042 | + '~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1043 | 1043 | // Unwanted trailing punctuation and whitespace. |
1044 | - '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1044 | + '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1045 | 1045 | // Unwanted opening punctuation and whitespace. |
1046 | - '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1046 | + '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1047 | 1047 | ), |
1048 | 1048 | array( |
1049 | 1049 | '', |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | $returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img"></a>'; |
1442 | 1442 | else |
1443 | 1443 | { |
1444 | - $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': ''; |
|
1444 | + $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
|
1445 | 1445 | $height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : ''; |
1446 | 1446 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>'; |
1447 | 1447 | } |
@@ -1452,7 +1452,7 @@ discard block |
||
1452 | 1452 | $width = !empty($width) ? ' width="' . $width . '"' : ''; |
1453 | 1453 | $height = !empty($height) ? ' height="' . $height . '"' : ''; |
1454 | 1454 | |
1455 | - $returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="'. $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
1455 | + $returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="' . $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
1456 | 1456 | } |
1457 | 1457 | // Audio. |
1458 | 1458 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | $width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;'; |
1461 | 1461 | $height = !empty($height) ? 'height: ' . $height . 'px;' : ''; |
1462 | 1462 | |
1463 | - $returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="'. $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>'; |
|
1463 | + $returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="' . $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>'; |
|
1464 | 1464 | } |
1465 | 1465 | // Anything else. |
1466 | 1466 | else |
@@ -1629,7 +1629,7 @@ discard block |
||
1629 | 1629 | 'type' => 'unparsed_commas_content', |
1630 | 1630 | 'test' => '\d+,\d+\]', |
1631 | 1631 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
1632 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1632 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1633 | 1633 | { |
1634 | 1634 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
1635 | 1635 | if (empty($scheme)) |
@@ -2171,12 +2171,12 @@ discard block |
||
2171 | 2171 | $codes[] = array( |
2172 | 2172 | 'tag' => 'cowsay', |
2173 | 2173 | 'parameters' => array( |
2174 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
2174 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
2175 | 2175 | { |
2176 | 2176 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2177 | 2177 | }, |
2178 | 2178 | ), |
2179 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
2179 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
2180 | 2180 | { |
2181 | 2181 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2182 | 2182 | }, |
@@ -3557,7 +3557,7 @@ discard block |
||
3557 | 3557 | if ($fp != false) |
3558 | 3558 | { |
3559 | 3559 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
3560 | - fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: '. SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n"); |
|
3560 | + fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: ' . SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n"); |
|
3561 | 3561 | |
3562 | 3562 | // Read in the HTTP/1.1 or whatever. |
3563 | 3563 | $test = substr(fgets($fp, 11), -1); |
@@ -4162,7 +4162,7 @@ discard block |
||
4162 | 4162 | $toMinify = array(); |
4163 | 4163 | $normal = array(); |
4164 | 4164 | |
4165 | - uasort($context['css_files'], function ($a, $b) |
|
4165 | + uasort($context['css_files'], function($a, $b) |
|
4166 | 4166 | { |
4167 | 4167 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
4168 | 4168 | }); |
@@ -5459,7 +5459,7 @@ discard block |
||
5459 | 5459 | { |
5460 | 5460 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
5461 | 5461 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5462 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5462 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5463 | 5463 | if ($keep_alive) |
5464 | 5464 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
5465 | 5465 | else |
@@ -5469,7 +5469,7 @@ discard block |
||
5469 | 5469 | { |
5470 | 5470 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
5471 | 5471 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5472 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5472 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5473 | 5473 | if ($keep_alive) |
5474 | 5474 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
5475 | 5475 | else |
@@ -5717,13 +5717,13 @@ discard block |
||
5717 | 5717 | |
5718 | 5718 | // UTF-8 occurences of MS special characters |
5719 | 5719 | $findchars_utf8 = array( |
5720 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
5721 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
5722 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
5723 | - "\xe2\x80\x98", // left single curly quote |
|
5724 | - "\xe2\x80\x99", // right single curly quote |
|
5725 | - "\xe2\x80\x9c", // left double curly quote |
|
5726 | - "\xe2\x80\x9d", // right double curly quote |
|
5720 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
5721 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
5722 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
5723 | + "\xe2\x80\x98", // left single curly quote |
|
5724 | + "\xe2\x80\x99", // right single curly quote |
|
5725 | + "\xe2\x80\x9c", // left double curly quote |
|
5726 | + "\xe2\x80\x9d", // right double curly quote |
|
5727 | 5727 | ); |
5728 | 5728 | |
5729 | 5729 | // windows 1252 / iso equivalents |
@@ -5739,13 +5739,13 @@ discard block |
||
5739 | 5739 | |
5740 | 5740 | // safe replacements |
5741 | 5741 | $replacechars = array( |
5742 | - ',', // ‚ |
|
5743 | - ',,', // „ |
|
5744 | - '...', // … |
|
5745 | - "'", // ‘ |
|
5746 | - "'", // ’ |
|
5747 | - '"', // “ |
|
5748 | - '"', // ” |
|
5742 | + ',', // ‚ |
|
5743 | + ',,', // „ |
|
5744 | + '...', // … |
|
5745 | + "'", // ‘ |
|
5746 | + "'", // ’ |
|
5747 | + '"', // “ |
|
5748 | + '"', // ” |
|
5749 | 5749 | ); |
5750 | 5750 | |
5751 | 5751 | if ($context['utf8']) |
@@ -6090,7 +6090,7 @@ discard block |
||
6090 | 6090 | $desc = implode(', ', array_slice(array_unique($tzvalue['locations']), 0, 5)) . (count($tzvalue['locations']) > 5 ? ', ' . $txt['etc'] : ''); |
6091 | 6091 | |
6092 | 6092 | // We don't want abbreviations like '+03' or '-11'. |
6093 | - $abbrs = array_filter($tzvalue['abbrs'], function ($abbr) { |
|
6093 | + $abbrs = array_filter($tzvalue['abbrs'], function($abbr) { |
|
6094 | 6094 | return !strspn($abbr, '+-'); |
6095 | 6095 | }); |
6096 | 6096 | $abbrs = count($abbrs) == count($tzvalue['abbrs']) ? array_unique($abbrs) : array(); |
@@ -7054,7 +7054,7 @@ discard block |
||
7054 | 7054 | EXISTS ( |
7055 | 7055 | SELECT bpv.id_board |
7056 | 7056 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7057 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
7057 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
7058 | 7058 | AND bpv.deny = 0 |
7059 | 7059 | AND bpv.id_board = b.id_board |
7060 | 7060 | )'; |
@@ -7064,7 +7064,7 @@ discard block |
||
7064 | 7064 | AND NOT EXISTS ( |
7065 | 7065 | SELECT bpv.id_board |
7066 | 7066 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7067 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
7067 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
7068 | 7068 | AND bpv.deny = 1 |
7069 | 7069 | AND bpv.id_board = b.id_board |
7070 | 7070 | )'; |
@@ -7335,8 +7335,8 @@ discard block |
||
7335 | 7335 | $i = 0; |
7336 | 7336 | while (empty($done)) |
7337 | 7337 | { |
7338 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
7339 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
7338 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
7339 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
7340 | 7340 | else |
7341 | 7341 | $done = true; |
7342 | 7342 | } |
@@ -7346,8 +7346,8 @@ discard block |
||
7346 | 7346 | $i = 0; |
7347 | 7347 | while (empty($done)) |
7348 | 7348 | { |
7349 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
7350 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
7349 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
7350 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
7351 | 7351 | else |
7352 | 7352 | $done = true; |
7353 | 7353 | } |
@@ -1704,7 +1704,7 @@ |
||
1704 | 1704 | // Missing, but we have a fallback. |
1705 | 1705 | else |
1706 | 1706 | { |
1707 | - usort($fallbacks[$tzid], function ($a, $b) { |
|
1707 | + usort($fallbacks[$tzid], function($a, $b) { |
|
1708 | 1708 | return $a['ts'] > $b['ts']; |
1709 | 1709 | }); |
1710 | 1710 |
@@ -1704,7 +1704,8 @@ |
||
1704 | 1704 | // Missing, but we have a fallback. |
1705 | 1705 | else |
1706 | 1706 | { |
1707 | - usort($fallbacks[$tzid], function ($a, $b) { |
|
1707 | + usort($fallbacks[$tzid], function ($a, $b) |
|
1708 | + { |
|
1708 | 1709 | return $a['ts'] > $b['ts']; |
1709 | 1710 | }); |
1710 | 1711 |
@@ -393,18 +393,18 @@ discard block |
||
393 | 393 | $quickbuttons = array( |
394 | 394 | 'approve' => array( |
395 | 395 | 'label' => $txt['approve'], |
396 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';approve='.$item['id'], |
|
396 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=' . $context['current_view'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';approve=' . $item['id'], |
|
397 | 397 | 'icon' => 'approve', |
398 | 398 | ), |
399 | 399 | 'delete' => array( |
400 | 400 | 'label' => $txt['remove'], |
401 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';delete='.$item['id'], |
|
401 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=' . $context['current_view'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';delete=' . $item['id'], |
|
402 | 402 | 'icon' => 'remove_button', |
403 | 403 | 'show' => $item['can_delete'] |
404 | 404 | ), |
405 | 405 | 'quickmod' => array( |
406 | 406 | 'class' => 'inline_mod_check', |
407 | - 'content' => '<input type="checkbox" name="item[]" value="'.$item['id'].'" checked>', |
|
407 | + 'content' => '<input type="checkbox" name="item[]" value="' . $item['id'] . '" checked>', |
|
408 | 408 | 'show' => !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 |
409 | 409 | ), |
410 | 410 | ); |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | $quickbuttons = array( |
470 | 470 | 'delete' => array( |
471 | 471 | 'label' => $txt['remove_message'], |
472 | - 'href' => $scripturl.'?action=moderate;area=userwatch;sa=post;delete='.$post['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'], |
|
472 | + 'href' => $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
473 | 473 | 'javascript' => 'data-confirm="' . $txt['mc_watched_users_delete_post'] . '"', |
474 | 474 | 'class' => 'you_sure', |
475 | 475 | 'icon' => 'remove_button', |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | ), |
94 | 94 | 'ignore' => array( |
95 | 95 | 'label' => $report['ignore'] ? $txt['mc_reportedp_unignore'] : $txt['mc_reportedp_ignore'], |
96 | - 'href' => $scripturl.'?action=moderate;area=reported'.$context['report_type'].';sa=handle;ignore='.(int)!$report['ignore'].';rid='.$report['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-ignore_token_var'].'='.$context['mod-report-ignore_token'], |
|
96 | + 'href' => $scripturl . '?action=moderate;area=reported' . $context['report_type'] . ';sa=handle;ignore=' . (int) !$report['ignore'] . ';rid=' . $report['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-report-ignore_token_var'] . '=' . $context['mod-report-ignore_token'], |
|
97 | 97 | 'javascript' => !$report['ignore'] ? ' data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : '', |
98 | 98 | 'class' => 'you_sure', |
99 | 99 | 'icon' => 'ignore' |
100 | 100 | ), |
101 | 101 | 'close' => array( |
102 | 102 | 'label' => $context['view_closed'] ? $txt['mc_reportedp_open'] : $txt['mc_reportedp_close'], |
103 | - 'href' => $scripturl.'?action=moderate;area=reported'.$context['report_type'].';sa=handle;closed='.(int)!$report['closed'].';rid='.$report['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-closed_token_var'].'='.$context['mod-report-closed_token'], |
|
103 | + 'href' => $scripturl . '?action=moderate;area=reported' . $context['report_type'] . ';sa=handle;closed=' . (int) !$report['closed'] . ';rid=' . $report['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-report-closed_token_var'] . '=' . $context['mod-report-closed_token'], |
|
104 | 104 | 'icon' => $context['view_closed'] ? 'folder' : 'close', |
105 | 105 | ), |
106 | 106 | ); |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | if ($context['report_type'] == 'posts') |
110 | 110 | $context['reports'][$key]['quickbuttons']['delete'] = array( |
111 | 111 | 'label' => $txt['mc_reportedp_delete'], |
112 | - 'href' => $scripturl.'?action=deletemsg;topic='.$report['topic']['id'].'.0;msg='.$report['topic']['id_msg'].';modcenter;'.$context['session_var'].'='.$context['session_id'], |
|
113 | - 'javascript' => 'data-confirm="'.$txt['mc_reportedp_delete_confirm'].'"', |
|
112 | + 'href' => $scripturl . '?action=deletemsg;topic=' . $report['topic']['id'] . '.0;msg=' . $report['topic']['id_msg'] . ';modcenter;' . $context['session_var'] . '=' . $context['session_id'], |
|
113 | + 'javascript' => 'data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '"', |
|
114 | 114 | 'class' => 'you_sure', |
115 | 115 | 'icon' => 'delete', |
116 | 116 | 'show' => !$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards'])) |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | |
119 | 119 | // Ban reported member/post author link |
120 | 120 | if ($context['report_type'] == 'members') |
121 | - $ban_link = $scripturl.'?action=admin;area=ban;sa=add;u='.$report['user']['id'].';'.$context['session_var'].'='.$context['session_id']; |
|
121 | + $ban_link = $scripturl . '?action=admin;area=ban;sa=add;u=' . $report['user']['id'] . ';' . $context['session_var'] . '=' . $context['session_id']; |
|
122 | 122 | else |
123 | - $ban_link = $scripturl.'?action=admin;area=ban;sa=add'.(!empty($report['author']['id']) ? ';u='.$report['author']['id'] : ';msg='.$report['topic']['id_msg']).';'.$context['session_var'].'='.$context['session_id']; |
|
123 | + $ban_link = $scripturl . '?action=admin;area=ban;sa=add' . (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']) . ';' . $context['session_var'] . '=' . $context['session_id']; |
|
124 | 124 | |
125 | 125 | $context['reports'][$key]['quickbuttons'] += array( |
126 | 126 | 'ban' => array( |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | ), |
132 | 132 | 'quickmod' => array( |
133 | 133 | 'class' => 'inline_mod_check', |
134 | - 'content' => '<input type="checkbox" name="close[]" value="'.$report['id'].'">', |
|
134 | + 'content' => '<input type="checkbox" name="close[]" value="' . $report['id'] . '">', |
|
135 | 135 | 'show' => !$context['view_closed'] |
136 | 136 | ) |
137 | 137 | ); |
@@ -1535,14 +1535,14 @@ discard block |
||
1535 | 1535 | $output['quickbuttons'] = array( |
1536 | 1536 | 'quote' => array( |
1537 | 1537 | 'label' => $txt['quote_action'], |
1538 | - 'href' => $scripturl.'?action=post;quote='.$output['id'].';topic='.$context['current_topic'], '.'.$context['start'].';last_msg='.$context['topic_last_message'], |
|
1539 | - 'javascript' => 'onclick="return oQuickReply.quote('.$output['id'].');"', |
|
1538 | + 'href' => $scripturl . '?action=post;quote=' . $output['id'] . ';topic=' . $context['current_topic'], '.' . $context['start'] . ';last_msg=' . $context['topic_last_message'], |
|
1539 | + 'javascript' => 'onclick="return oQuickReply.quote(' . $output['id'] . ');"', |
|
1540 | 1540 | 'icon' => 'quote', |
1541 | 1541 | 'show' => $context['can_quote'] |
1542 | 1542 | ), |
1543 | 1543 | 'quote_selected' => array( |
1544 | 1544 | 'label' => $txt['quote_selected_action'], |
1545 | - 'id' => 'quoteSelected_'. $output['id'], |
|
1545 | + 'id' => 'quoteSelected_' . $output['id'], |
|
1546 | 1546 | 'href' => 'javascript:void(0)', |
1547 | 1547 | 'custom' => 'style="display:none"', |
1548 | 1548 | 'icon' => 'quote_selected', |
@@ -1551,74 +1551,74 @@ discard block |
||
1551 | 1551 | 'quick_edit' => array( |
1552 | 1552 | 'label' => $txt['quick_edit'], |
1553 | 1553 | 'class' => 'quick_edit', |
1554 | - 'id' => 'modify_button_'. $output['id'], |
|
1555 | - 'custom' => 'onclick="oQuickModify.modifyMsg(\''.$output['id'].'\', \''.!empty($modSettings['toggle_subject']).'\')"', |
|
1554 | + 'id' => 'modify_button_' . $output['id'], |
|
1555 | + 'custom' => 'onclick="oQuickModify.modifyMsg(\'' . $output['id'] . '\', \'' . !empty($modSettings['toggle_subject']) . '\')"', |
|
1556 | 1556 | 'icon' => 'quick_edit_button', |
1557 | 1557 | 'show' => $output['can_modify'] |
1558 | 1558 | ), |
1559 | 1559 | 'more' => array( |
1560 | 1560 | 'modify' => array( |
1561 | 1561 | 'label' => $txt['modify'], |
1562 | - 'href' => $scripturl.'?action=post;msg='.$output['id'].';topic='.$context['current_topic'].'.'.$context['start'], |
|
1562 | + 'href' => $scripturl . '?action=post;msg=' . $output['id'] . ';topic=' . $context['current_topic'] . '.' . $context['start'], |
|
1563 | 1563 | 'icon' => 'modify_button', |
1564 | 1564 | 'show' => $output['can_modify'] |
1565 | 1565 | ), |
1566 | 1566 | 'remove_topic' => array( |
1567 | 1567 | 'label' => $txt['remove_topic'], |
1568 | - 'href' => $scripturl.'?action=removetopic2;topic='.$context['current_topic'].'.'.$context['start'].';'.$context['session_var'].'='.$context['session_id'], |
|
1569 | - 'javascript' => 'data-confirm="'.$txt['are_sure_remove_topic'].'"', |
|
1568 | + 'href' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
1569 | + 'javascript' => 'data-confirm="' . $txt['are_sure_remove_topic'] . '"', |
|
1570 | 1570 | 'class' => 'you_sure', |
1571 | 1571 | 'icon' => 'remove_button', |
1572 | 1572 | 'show' => $context['can_delete'] && ($context['topic_first_message'] == $output['id']) |
1573 | 1573 | ), |
1574 | 1574 | 'remove' => array( |
1575 | 1575 | 'label' => $txt['remove'], |
1576 | - 'href' => $scripturl.'?action=deletemsg;topic='.$context['current_topic'].'.'.$context['start'].';msg='.$output['id'].';'.$context['session_var'].'='.$context['session_id'], |
|
1577 | - 'javascript' => 'data-confirm="'.$txt['remove_message_question'].'"', |
|
1576 | + 'href' => $scripturl . '?action=deletemsg;topic=' . $context['current_topic'] . '.' . $context['start'] . ';msg=' . $output['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
1577 | + 'javascript' => 'data-confirm="' . $txt['remove_message_question'] . '"', |
|
1578 | 1578 | 'class' => 'you_sure', |
1579 | 1579 | 'icon' => 'remove_button', |
1580 | 1580 | 'show' => $output['can_remove'] && ($context['topic_first_message'] != $output['id']) |
1581 | 1581 | ), |
1582 | 1582 | 'split' => array( |
1583 | 1583 | 'label' => $txt['split'], |
1584 | - 'href' => $scripturl.'?action=splittopics;topic='.$context['current_topic'].'.0;at='.$output['id'], |
|
1584 | + 'href' => $scripturl . '?action=splittopics;topic=' . $context['current_topic'] . '.0;at=' . $output['id'], |
|
1585 | 1585 | 'icon' => 'split_button', |
1586 | 1586 | 'show' => $context['can_split'] && !empty($context['real_num_replies']) |
1587 | 1587 | ), |
1588 | 1588 | 'report' => array( |
1589 | 1589 | 'label' => $txt['report_to_mod'], |
1590 | - 'href' => $scripturl.'?action=reporttm;topic='.$context['current_topic'].'.'.$output['counter'].';msg='.$output['id'], |
|
1590 | + 'href' => $scripturl . '?action=reporttm;topic=' . $context['current_topic'] . '.' . $output['counter'] . ';msg=' . $output['id'], |
|
1591 | 1591 | 'icon' => 'error', |
1592 | 1592 | 'show' => $context['can_report_moderator'] |
1593 | 1593 | ), |
1594 | 1594 | 'warn' => array( |
1595 | 1595 | 'label' => $txt['issue_warning'], |
1596 | - 'href' => $scripturl.'?action=profile;area=issuewarning;u='.$output['member']['id'].';msg='.$output['id'], |
|
1596 | + 'href' => $scripturl . '?action=profile;area=issuewarning;u=' . $output['member']['id'] . ';msg=' . $output['id'], |
|
1597 | 1597 | 'icon' => 'warn_button', |
1598 | 1598 | 'show' => $context['can_issue_warning'] && !$output['is_message_author'] && !$output['member']['is_guest'] |
1599 | 1599 | ), |
1600 | 1600 | 'restore' => array( |
1601 | 1601 | 'label' => $txt['restore_message'], |
1602 | - 'href' => $scripturl.'?action=restoretopic;msgs='.$output['id'].';'.$context['session_var'].'='.$context['session_id'], |
|
1602 | + 'href' => $scripturl . '?action=restoretopic;msgs=' . $output['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
1603 | 1603 | 'icon' => 'restore_button', |
1604 | 1604 | 'show' => $context['can_restore_msg'] |
1605 | 1605 | ), |
1606 | 1606 | 'approve' => array( |
1607 | 1607 | 'label' => $txt['approve'], |
1608 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa=approve;topic='.$context['current_topic'].'.'.$context['start'].';msg='.$output['id'].';'.$context['session_var'].'='.$context['session_id'], |
|
1608 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=approve;topic=' . $context['current_topic'] . '.' . $context['start'] . ';msg=' . $output['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
1609 | 1609 | 'icon' => 'approve_button', |
1610 | 1610 | 'show' => $output['can_approve'] |
1611 | 1611 | ), |
1612 | 1612 | 'unapprove' => array( |
1613 | 1613 | 'label' => $txt['unapprove'], |
1614 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa=approve;topic='.$context['current_topic'].'.'.$context['start'].';msg='.$output['id'].';'.$context['session_var'].'='.$context['session_id'], |
|
1614 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=approve;topic=' . $context['current_topic'] . '.' . $context['start'] . ';msg=' . $output['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
1615 | 1615 | 'icon' => 'unapprove_button', |
1616 | 1616 | 'show' => $output['can_unapprove'] |
1617 | 1617 | ), |
1618 | 1618 | ), |
1619 | 1619 | 'quickmod' => array( |
1620 | 1620 | 'class' => 'inline_mod_check', |
1621 | - 'id' => 'in_topic_mod_check_'. $output['id'], |
|
1621 | + 'id' => 'in_topic_mod_check_' . $output['id'], |
|
1622 | 1622 | 'custom' => 'style="display: none;"', |
1623 | 1623 | 'content' => '', |
1624 | 1624 | 'show' => !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $output['can_remove'] |