Skip to content
This repository was archived by the owner on Nov 20, 2019. It is now read-only.

Commit e570f7a

Browse files
authored
fix(IDN): use INTL_IDNA_VARIANT_UTS46 for idn_* functions (#20)
* fix(IDN): use INTL_IDNA_VARIANT_UTS46 for idn_* functions * fix(IDN): use INTL_IDNA_VARIANT_UTS46 for idn_* functions
1 parent c27974a commit e570f7a

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ env:
2323
- ENGINE=php VERSION=7.0 INTL=1
2424
- ENGINE=php VERSION=7.1 INTL=0
2525
- ENGINE=php VERSION=7.1 INTL=1
26+
- ENGINE=php VERSION=7.2 INTL=0
27+
- ENGINE=php VERSION=7.2 INTL=1
2628
- ENGINE=hhvm INTL=0
2729

2830
before_script:

src/IDN.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public function toASCII($domain)
3838
return $this->transformer->encode($domain);
3939
}
4040

41+
if (defined('INTL_IDNA_VARIANT_UTS46')) {
42+
return idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
43+
}
44+
4145
return idn_to_ascii($domain);
4246
}
4347

@@ -54,6 +58,10 @@ public function toUTF8($domain)
5458
return $this->transformer->decode($domain);
5559
}
5660

61+
if (defined('INTL_IDNA_VARIANT_UTS46')) {
62+
return idn_to_utf8($domain, 0, INTL_IDNA_VARIANT_UTS46);
63+
}
64+
5765
return idn_to_utf8($domain);
5866
}
5967
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM php:7.2-rc
2+
3+
RUN apt-get update && apt-get install -y git zlib1g-dev libicu-dev g++
4+
RUN docker-php-ext-install intl
5+
RUN docker-php-ext-install zip
6+
7+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer

travis/docker/php-7.2/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM php:7.2-rc
2+
3+
RUN apt-get update && apt-get install -y git zlib1g-dev
4+
RUN docker-php-ext-install zip
5+
6+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer

0 commit comments

Comments
 (0)