php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41892 url parsing bug
Submitted: 2007-07-04 09:04 UTC Modified: 2007-07-07 20:18 UTC
From: a dot fokin at new-vision dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5.2.3 OS: windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: a dot fokin at new-vision dot com
New email:
PHP Version: OS:

 

 [2007-07-04 09:04 UTC] a dot fokin at new-vision dot com
Description:
------------
when i try to http authenticate by url with user name, containing '@', i got '6' returned.

Reproduce code:
---------------
<?php
$ch = curl_init();
curl_setopt(
  $ch, 
  CURLOPT_URL, 
  "http://a.fokin@new-vision.com:foksas@www.example.com"
);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
$errno = curl_errno($ch);
echo $errno;
?>

Expected result:
----------------
You have reached this web page by typing "example.com", "example.net", or "example.org" into your web browser.

These domain names are reserved for use in documentation and are not available for registration. See RFC 2606, Section 3.
/0/

Actual result:
--------------
/6/

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-04 11:53 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2007-07-05 06:09 UTC] a dot fokin at new-vision dot com
I am 99,5% sure, that this is not a support or development question.

When i use http://111:222@www.example.com - everything is fine,
but when i use http://111@111.111:222@www.example.com - curl reads it as if username is `111`, no password given and actual url (host) is `111.111:foksas@www.bugzilla.com`, which is wrong url parsing.

I'm not asking here for help or feedback (in some case ;)). Just want to make sure, that you actually read current "bogus" description and understand what is the problem. 

And sorry for spam if i am wrong ;).
 [2007-07-07 19:34 UTC] a dot fokin at new-vision dot com
since i got no reaction to the last comment, i'm opening this thing again.

Any kind of reaction would be nice... even 'stop spamming, it is really not a bug' will perfectly satisfy me ;)
 [2007-07-07 19:53 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

1. You have to encode the @ using urlencoding
2. PHP just passes the string to curl so if there'S something wrong it's curl not PHP.
 [2007-07-07 20:18 UTC] a dot fokin at new-vision dot com
Really really sorry for that bogus. Next time ill probably trible-check the documentation. It will never happen again (i hope). Everything works just fine and thanks for extra fast reply, that helped a lot ;).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 18:02:40 2024 UTC