| @@ -137,8 +137,9 @@ | ||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | public function emailToUTF8($input, $one_time_encoding = false) |
| 140 | 140 | { |
| 141 | + // Optionally set | |
| 141 | 142 | if ($one_time_encoding) { |
| 142 | 143 | switch ($one_time_encoding) { |
| 143 | 144 | case 'utf8': |
| 144 | 145 | case 'ucs4_string': |
| @@ -152,8 +153,9 @@ | ||
| 152 | 153 | } |
| 153 | 154 | $input = trim($input); |
| 154 | 155 | |
| 155 | 156 | if (strpos($input, '@')) { // Maybe it is an email address |
| 157 | + // No no in strict mode | |
| 156 | 158 | if ($this->_strict_mode) { |
| 157 | 159 | return false; |
| 158 | 160 | } |
| 159 | 161 | [$email_pref, $input] = explode('@', $input, 2); |
| @@ -177,9 +179,9 @@ | ||
| 177 | 179 | } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters) |
| 178 | 180 | if ($this->_strict_mode) { |
| 179 | 181 | return false; |
| 180 | 182 | } |
| 181 | - $parsed = parse_url($input); | |
| 183 | + $parsed = acym_parseUrl($input); | |
| 182 | 184 | if (isset($parsed['host'])) { |
| 183 | 185 | $arr = explode('.', $parsed['host']); |
| 184 | 186 | foreach ($arr as $k => $v) { |
| 185 | 187 | $conv = $this->_decode($v); |
| @@ -297,8 +299,9 @@ | ||
| 297 | 299 | case 0x3002: |
| 298 | 300 | case 0xFF0E: |
| 299 | 301 | case 0xFF61: |
| 300 | 302 | $decoded[$k] = 0x2E; |
| 303 | + // normal I guess | |
| 301 | 304 | case 0x2E: |
| 302 | 305 | case 0x2F: |
| 303 | 306 | case 0x3A: |
| 304 | 307 | case 0x3F: |