Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Bug #17542: URIs get mangled when decoding (UTF8-fix)

* added missing exception-file to package.xml


git-svn-id: http://svn.php.net/repository/pear/packages/Net_IDNA2/trunk@306130 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 395d9f5587d70df5ea97cea1d227fbd442559d23 1 parent 68c072e
@neufeind neufeind authored
Showing with 14 additions and 5 deletions.
  1. +1 −0  package.xml
  2. +13 −5 tests/Net_IDNA2Test.php
View
1  package.xml
@@ -40,6 +40,7 @@
<dir baseinstalldir="/" name="/">
<file baseinstalldir="/" md5sum="5ea959233cb234919f7326ddb7ccb47c" name="Net/IDNA2.php" role="php" />
<file baseinstalldir="/" md5sum="5ea959233cb234919f7326ddb7ccb47c" name="Net/IDNA2/Exception.php" role="php" />
+ <file baseinstalldir="/" md5sum="5ea959233cb234919f7326ddb7ccb47c" name="Net/IDNA2/Exception/Nameprep.php" role="php" />
<file baseinstalldir="/" md5sum="d4bec3bf5209b1b15d60f6bda5e96eeb" name="docs/examples/example_web.php" role="doc" />
<file baseinstalldir="/" md5sum="d4bec3bf5209b1b15d60f6bda5e96eeb" name="tests/AllTests.php" role="test" />
<file baseinstalldir="/" md5sum="d4bec3bf5209b1b15d60f6bda5e96eeb" name="tests/Net_IDNA2Test.php" role="test" />
View
18 tests/Net_IDNA2Test.php
@@ -15,15 +15,23 @@ public function setUp()
}
/**
- * Test if a complete URL consisting also of port-number etc. will be decoded just fine
+ * Test if a complete URL consisting also of port-number etc. will be decoded just fine, test 1
*
* @return void
*/
- public function testShouldDecodePortNumbersFragmentsAndUrisCorrectly()
+ public function testShouldDecodePortNumbersFragmentsAndUrisCorrectly1()
+ {
+ $result = $this->idn->decode('http://www.xn--ml-6kctd8d6a.org:8080/test.php?arg1=1&arg2=2#fragment');
+ $this->assertSame("http://www.\xD0\xB5\xD1\x85\xD0\xB0m\xD1\x80l\xD0\xB5.org:8080/test.php?arg1=1&arg2=2#fragment", $result);
+ }
+
+ /**
+ * Test if a complete URL consisting also of port-number etc. will be decoded just fine, test 2
+ *
+ * @return void
+ */
+ public function testShouldDecodePortNumbersFragmentsAndUrisCorrectly2()
{
- // not sure where this testcase came from, but it's wrong
- // $result = $this->idn->decode('http://www.xn--ml-6kctd8d6a.org:8080/test.php?arg1=1&arg2=2#fragment');
- // $this->assertSame("http://www.ехаmрlе.org:8080/test.php?arg=1#fragment", $result);
$result = $this->idn->decode('http://xn--tst-qla.example.com:8080/test.php?arg1=1&arg2=2#fragment');
$this->assertSame("http://täst.example.com:8080/test.php?arg1=1&arg2=2#fragment", $result);
}
Please sign in to comment.
Something went wrong with that request. Please try again.