@@ -927,7 +927,8 @@ discard block |
||
| 927 | 927 | smf_db_transaction('rollback'); |
| 928 | 928 | |
| 929 | 929 | if(empty($db_persist)) |
| 930 | - { // without pooling |
|
| 930 | + { |
|
| 931 | +// without pooling |
|
| 931 | 932 | if (empty($pg_error_data_prep)) |
| 932 | 933 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
| 933 | 934 | 'INSERT INTO ' . $db_prefix . 'log_errors |
@@ -938,7 +939,8 @@ discard block |
||
| 938 | 939 | pg_execute($db_connection, 'smf_log_errors', $error_array); |
| 939 | 940 | } |
| 940 | 941 | else |
| 941 | - { //with pooling |
|
| 942 | + { |
|
| 943 | +//with pooling |
|
| 942 | 944 | $pg_error_data_prep = pg_prepare($db_connection, '', |
| 943 | 945 | 'INSERT INTO ' . $db_prefix . 'log_errors |
| 944 | 946 | (id_member, log_time, ip, url, message, session, error_type, file, line, backtrace) |
@@ -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 self::IDNA_ERROR_LABEL_TOO_LONG: |
| 167 | 169 | case self::IDNA_ERROR_LEADING_HYPHEN: |
| 168 | 170 | case self::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 | |