FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=14426&edit=1

ID: 14426
Updated by: daniel.oconnor@gmail.com
Reported By: mario at uni dot de
Summary: Decode of URL with GET parameters
-Status: Feedback
+Status: Open
Type: Bug
Package: Net_IDNA
Operating System: Linux
Package Version: 0.7.2
PHP Version: 5.2.0
Assigned To: neufeind
Roadmap Versions:
New Comment:

-Status: Feedback
+Status: Open



Previous Comments:
------------------------------------------------------------------------

[2010-05-24 10:24:55] tokul

one more thing. parse_data() output also includes 'port'. See how
Net_IDNA decodes it.

var_dump(parse_url('http://xn--ko-eka.de:8080/index.php?foo=bar'));

------------------------------------------------------------------------

[2010-05-24 07:57:21] tokul

1. bug report talks about changes in php4.php, yet version number is set
to php 5.2.0

2. both php4.php and php5.php have same bug.

Test script (PHP 4.4.9, Net_IDNA 0.7.3, dublicate net_idna declaration
disabled by renaming net_idna class in Net/IDNA/php4.php)

------
<?php
var_dump(include('Net/IDNA.php'));
$idn_instance = Net_IDNA::getInstance();
var_dump($idn_instance->decode('http://xn--ko-eka.de/index.php?foo=bar'));
------
Result
---
X-Powered-By: PHP/4.4.9
Content-type: text/html

int(1)
string(31) "http://öko.de/index.phpfoo=bar"
------
Expected
---
X-Powered-By: PHP/4.4.9
Content-type: text/html

int(1)
string(31) "http://öko.de/index.php?foo=bar"
------
There is nothing to think about it. Code creates URL by calling join
with empty delimiter. query part needs delimiter.

var_dump(parse_url('http://xn--ko-eka.de/index.php?foo=bar'));

array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
string(13) "xn--ko-eka.de"
["path"]=>
string(10) "/index.php"
["query"]=>
string(7) "foo=bar"
}

------------------------------------------------------------------------

[2009-07-24 06:26:53] doconnor

-Status: Assigned
+Status: Feedback
We are unable to reproduce the bug as reported.
Please provide a simple script (10 lines or less)
or a link to an external script that can be used
to reproduce the bug.

If you can provide the script, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PEAR.


Need a reproduce script or test before i fix this

------------------------------------------------------------------------

[2008-07-31 06:00:43] marlow

Description:
------------
Hello,

when I decode the URL

http://xn--ko-eka.de/index.php?foo=bar

I get this result

http://öko.de/index.phpfoo=bar

The ? is missing.

I changed php4.php line 2195 to fix it:

#$return = join('', $parsed);
$return = $parsed['scheme'].$parsed['host'].$parsed['path'];
if (isset($parsed['query'])) {
$return .= '?'.$parsed['query'];
}

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 29, '11 at 8:11a
activeSep 29, '11 at 8:11a
posts1
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 1 post

People

Translate

site design / logo © 2022 Grokbase