Skip to content

Commit ca1db31

Browse files
committed
[6.0] Fix emailToPunycode() throws "Prohibited input U+0000005C" with backslash before quote
Resolves #46356
1 parent 961dd0c commit ca1db31

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libraries/src/Filter/InputFilter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ public function emailToPunycode($text)
151151

152152
if (preg_match_all($pattern, $text, $matches)) {
153153
foreach ($matches[0] as $match) {
154-
$match = (string) str_replace(['?', '"'], '', $match);
155-
$text = (string) str_replace($match, PunycodeHelper::emailToPunycode($match), $text);
154+
try {
155+
$match = (string) str_replace(['?', '"'], '', $match);
156+
$text = (string) str_replace($match, PunycodeHelper::emailToPunycode($match), $text);
157+
} catch (\Exception) {}
156158
}
157159
}
158160

0 commit comments

Comments
 (0)