This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -645,7 +645,7 @@ private function filterFragment($fragment)
645645 private function filterQueryOrFragment ($ value )
646646 {
647647 return preg_replace_callback (
648- '/(?:[^ ' . self ::CHAR_UNRESERVED . self ::CHAR_SUB_DELIMS . '%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/ ' ,
648+ '/(?:[^ ' . self ::CHAR_UNRESERVED . self ::CHAR_SUB_DELIMS . '%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/u ' ,
649649 [$ this , 'urlEncodeChar ' ],
650650 $ value
651651 );
Original file line number Diff line number Diff line change @@ -588,6 +588,24 @@ public function utf8PathsDataProvider()
588588 ];
589589 }
590590
591+ /**
592+ * @dataProvider utf8QueryStringsDataProvider
593+ */
594+ public function testUtf8Query ($ url , $ result )
595+ {
596+ $ uri = new Uri ($ url );
597+
598+ $ this ->assertEquals ($ result , $ uri ->getQuery ());
599+ }
600+
601+ public function utf8QueryStringsDataProvider ()
602+ {
603+ return [
604+ ['http://example.com/?q=тестовый_путь ' , 'q=тестовый_путь ' ],
605+ ['http://example.com/?q=ουτοπία ' , 'q=ουτοπία ' ],
606+ ];
607+ }
608+
591609 public function testUriDoesNotAppendColonToHostIfPortIsEmpty ()
592610 {
593611 $ uri = (new Uri ())->withHost ('google.com ' );
You can’t perform that action at this time.
0 commit comments