Skip to content

Commit

Permalink
Merge pull request #2 from ChristophWurst/fix/encode-null-horde
Browse files Browse the repository at this point in the history
Fix encoding null with PHP8.1
  • Loading branch information
mrubinsk committed Nov 6, 2022
2 parents 2e9ab2e + 81d7f74 commit e40eae1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Horde/Idna.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ public static function encode($data)
{
switch ($backend = static::_getBackend()) {
case 'INTL':
if ($data === null) {
return false;
}
return idn_to_ascii($data);

case 'INTL_UTS46':
if ($data === null) {
return false;
}
$result = idn_to_ascii($data, 0, INTL_IDNA_VARIANT_UTS46, $info);
self::_checkForError($info);
return $result;
Expand Down

0 comments on commit e40eae1

Please sign in to comment.