@@ -155,8 +155,7 @@ |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | // No access if you don't have permission to see this attachment. |
| 158 | - if |
|
| 159 | - ( |
|
| 158 | + if ( |
|
| 160 | 159 | // This was from SMF or a hook didn't claim it. |
| 161 | 160 | ( |
| 162 | 161 | empty($file['source']) |
@@ -181,8 +181,7 @@ |
||
| 181 | 181 | ) |
| 182 | 182 | // We are not previewing an attachment. |
| 183 | 183 | && !isset($_SESSION['attachments_can_preview'][$attachId]) |
| 184 | - ) |
|
| 185 | - { |
|
| 184 | + ) { |
|
| 186 | 185 | send_http_status(404, 'File Not Found'); |
| 187 | 186 | die('404 File Not Found'); |
| 188 | 187 | } |
@@ -149,16 +149,16 @@ discard block |
||
| 149 | 149 | { |
| 150 | 150 | global $context, $txt; |
| 151 | 151 | |
| 152 | - if (!in_array($txt[self::CLASS_KEY .'_settings'], $config_vars)) |
|
| 152 | + if (!in_array($txt[self::CLASS_KEY . '_settings'], $config_vars)) |
|
| 153 | 153 | { |
| 154 | - $config_vars[] = $txt[self::CLASS_KEY .'_settings']; |
|
| 154 | + $config_vars[] = $txt[self::CLASS_KEY . '_settings']; |
|
| 155 | 155 | $config_vars[] = array( |
| 156 | 156 | self::CLASS_KEY, |
| 157 | - $txt[self::CLASS_KEY .'_servers'], |
|
| 157 | + $txt[self::CLASS_KEY . '_servers'], |
|
| 158 | 158 | 'file', |
| 159 | 159 | 'text', |
| 160 | 160 | 0, |
| 161 | - 'subtext' => $txt[self::CLASS_KEY .'_servers_subtext']); |
|
| 161 | + 'subtext' => $txt[self::CLASS_KEY . '_servers_subtext']); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (!isset($context['settings_post_javascript'])) |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $context['settings_post_javascript'] .= ' |
| 169 | 169 | $("#cache_accelerator").change(function (e) { |
| 170 | 170 | var cache_type = e.currentTarget.value; |
| 171 | - $("#'. self::CLASS_KEY .'").prop("disabled", cache_type != "MemcacheImplementation" && cache_type != "MemcachedImplementation"); |
|
| 171 | + $("#'. self::CLASS_KEY . '").prop("disabled", cache_type != "MemcacheImplementation" && cache_type != "MemcachedImplementation"); |
|
| 172 | 172 | });'; |
| 173 | 173 | } |
| 174 | 174 | |
@@ -149,16 +149,16 @@ discard block |
||
| 149 | 149 | { |
| 150 | 150 | global $context, $txt; |
| 151 | 151 | |
| 152 | - if (!in_array($txt[self::CLASS_KEY .'_settings'], $config_vars)) |
|
| 152 | + if (!in_array($txt[self::CLASS_KEY . '_settings'], $config_vars)) |
|
| 153 | 153 | { |
| 154 | - $config_vars[] = $txt[self::CLASS_KEY .'_settings']; |
|
| 154 | + $config_vars[] = $txt[self::CLASS_KEY . '_settings']; |
|
| 155 | 155 | $config_vars[] = array( |
| 156 | 156 | self::CLASS_KEY, |
| 157 | - $txt[self::CLASS_KEY .'_servers'], |
|
| 157 | + $txt[self::CLASS_KEY . '_servers'], |
|
| 158 | 158 | 'file', |
| 159 | 159 | 'text', |
| 160 | 160 | 0, |
| 161 | - 'subtext' => $txt[self::CLASS_KEY .'_servers_subtext']); |
|
| 161 | + 'subtext' => $txt[self::CLASS_KEY . '_servers_subtext']); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (!isset($context['settings_post_javascript'])) |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $context['settings_post_javascript'] .= ' |
| 169 | 169 | $("#cache_accelerator").change(function (e) { |
| 170 | 170 | var cache_type = e.currentTarget.value; |
| 171 | - $("#'. self::CLASS_KEY .'").prop("disabled", cache_type != "MemcacheImplementation" && cache_type != "MemcachedImplementation"); |
|
| 171 | + $("#'. self::CLASS_KEY . '").prop("disabled", cache_type != "MemcacheImplementation" && cache_type != "MemcachedImplementation"); |
|
| 172 | 172 | });'; |
| 173 | 173 | } |
| 174 | 174 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | global $context, $scripturl, $txt, $settings, $options, $modSettings; |
| 279 | 279 | |
| 280 | 280 | echo ' |
| 281 | - <div class="windowbg" id="msg', $message['id'],'"> |
|
| 281 | + <div class="windowbg" id="msg', $message['id'], '"> |
|
| 282 | 282 | <div class="post_wrapper"> |
| 283 | 283 | <div class="poster">'; |
| 284 | 284 | |
@@ -1961,7 +1961,7 @@ discard block |
||
| 1961 | 1961 | <div class="smalltext"> |
| 1962 | 1962 | <div class="recipient_to"><strong>', $txt['pm_to'], ':</strong> ', implode(', ', $draft['recipients']['to']), '</div>'; |
| 1963 | 1963 | |
| 1964 | - if(!empty($draft['recipients']['bcc'])) |
|
| 1964 | + if (!empty($draft['recipients']['bcc'])) |
|
| 1965 | 1965 | echo' |
| 1966 | 1966 | <div class="pm_bbc"><strong>', $txt['pm_bcc'], ':</strong> ', implode(', ', $draft['recipients']['bcc']), '</div>'; |
| 1967 | 1967 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | } |
| 242 | 242 | if ($c === $n) { |
| 243 | 243 | $q = $delta; |
| 244 | - for ($k = static::BASE;; $k += static::BASE) { |
|
| 244 | + for ($k = static::BASE; ; $k += static::BASE) { |
|
| 245 | 245 | $t = $this->calculateThreshold($k, $bias); |
| 246 | 246 | if ($q < $t) { |
| 247 | 247 | break; |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | $oldi = $i; |
| 345 | 345 | $w = 1; |
| 346 | 346 | |
| 347 | - for ($k = static::BASE;; $k += static::BASE) |
|
| 347 | + for ($k = static::BASE; ; $k += static::BASE) |
|
| 348 | 348 | { |
| 349 | 349 | if (!isset($input[$pos]) || !isset(static::$decodeTable[$input[$pos]])) |
| 350 | 350 | return false; |
@@ -157,12 +157,14 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | $parts = explode('.', $preprocessed); |
| 160 | - foreach ($parts as $p => &$part) { |
|
| 160 | + foreach ($parts as $p => &$part) |
|
| 161 | + { |
|
| 161 | 162 | $part = $this->encodePart($part); |
| 162 | 163 | |
| 163 | 164 | $validation_status = $this->validateLabel($part, true); |
| 164 | 165 | |
| 165 | - switch ($validation_status) { |
|
| 166 | + switch ($validation_status) |
|
| 167 | + { |
|
| 166 | 168 | case IDNA_ERROR_LABEL_TOO_LONG: |
| 167 | 169 | case IDNA_ERROR_LEADING_HYPHEN: |
| 168 | 170 | case IDNA_ERROR_TRAILING_HYPHEN: |
@@ -215,13 +217,16 @@ discard block |
||
| 215 | 217 | $h = $b = count($codePoints['basic']); |
| 216 | 218 | |
| 217 | 219 | $output = ''; |
| 218 | - foreach ($codePoints['basic'] as $code) { |
|
| 220 | + foreach ($codePoints['basic'] as $code) |
|
| 221 | + { |
|
| 219 | 222 | $output .= $this->codePointToChar($code); |
| 220 | 223 | } |
| 221 | - if ($input === $output) { |
|
| 224 | + if ($input === $output) |
|
| 225 | + { |
|
| 222 | 226 | return $output; |
| 223 | 227 | } |
| 224 | - if ($b > 0) { |
|
| 228 | + if ($b > 0) |
|
| 229 | + { |
|
| 225 | 230 | $output .= static::DELIMITER; |
| 226 | 231 | } |
| 227 | 232 | |
@@ -230,20 +235,26 @@ discard block |
||
| 230 | 235 | |
| 231 | 236 | $i = 0; |
| 232 | 237 | $length = mb_strlen($input, $this->encoding); |
| 233 | - while ($h < $length) { |
|
| 238 | + while ($h < $length) |
|
| 239 | + { |
|
| 234 | 240 | $m = $codePoints['nonBasic'][$i++]; |
| 235 | 241 | $delta = $delta + ($m - $n) * ($h + 1); |
| 236 | 242 | $n = $m; |
| 237 | 243 | |
| 238 | - foreach ($codePoints['all'] as $c) { |
|
| 239 | - if ($c < $n || $c < static::INITIAL_N) { |
|
| 244 | + foreach ($codePoints['all'] as $c) |
|
| 245 | + { |
|
| 246 | + if ($c < $n || $c < static::INITIAL_N) |
|
| 247 | + { |
|
| 240 | 248 | $delta++; |
| 241 | 249 | } |
| 242 | - if ($c === $n) { |
|
| 250 | + if ($c === $n) |
|
| 251 | + { |
|
| 243 | 252 | $q = $delta; |
| 244 | - for ($k = static::BASE;; $k += static::BASE) { |
|
| 253 | + for ($k = static::BASE;; $k += static::BASE) |
|
| 254 | + { |
|
| 245 | 255 | $t = $this->calculateThreshold($k, $bias); |
| 246 | - if ($q < $t) { |
|
| 256 | + if ($q < $t) |
|
| 257 | + { |
|
| 247 | 258 | break; |
| 248 | 259 | } |
| 249 | 260 | |