Browse Source

Fixed idn_to_ascii function call to prevent incorrect translation

Without the `IDNA_NONTRANSITIONAL_TO_ASCII` parameter, domain `faß.de`
gets converted to `fass.de` that is not correct way of making IDN.

Follows http://www.unicode.org/reports/tr46/
tags/2.0.16
SilverFire - Dmitry Naumenko 6 years ago
parent
commit
cd0e0e71c1
No known key found for this signature in database
GPG Key ID: 39DD917A92B270A
  1. 2
      framework/validators/EmailValidator.php
  2. 2
      framework/validators/UrlValidator.php

2
framework/validators/EmailValidator.php

@ -112,7 +112,7 @@ class EmailValidator extends Validator
return idn_to_ascii($idn);
}
return idn_to_ascii($idn, 0, INTL_IDNA_VARIANT_UTS46);
return idn_to_ascii($idn, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
}
/**

2
framework/validators/UrlValidator.php

@ -115,7 +115,7 @@ class UrlValidator extends Validator
return idn_to_ascii($idn);
}
return idn_to_ascii($idn, 0, INTL_IDNA_VARIANT_UTS46);
return idn_to_ascii($idn, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
}
/**

Loading…
Cancel
Save