#20308 [Opn->Csd]: parse_url does not understand the Mailto scheme
| From: | pollita@php.net | Date: | Fri, 29 Nov 2002 17:59:34 +0000 |
| Subject: | #20308 [Opn->Csd]: parse_url does not understand the Mailto scheme | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26199@lists.php.net to get a copy of this message | ||
ID: 20308
Updated by: pollita@php.net
Reported By: Otto.Stolz@uni-konstanz.de
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: SunOS
PHP Version: 4.2.2
New Comment:
After much back-and-forth on php-dev it was decided to leave
parse_url() as is.
To achieve the functionality you're looking for try something like the
following:
$addr =
parse_url('mailto:testuser@example.com?Subject=Here+is+an+email');
list($email,$params) = explode("?",$addr,2);
list($user,$host) = explode("@",$email,2);
// $user == "testuser";
// $host == "example.com";
// $params = "Subject=Here+is+an+email";
Previous Comments:
------------------------------------------------------------------------
[2002-11-08 04:45:34] wez@php.net
PHP does not parse out those parts of the mailto url;
re-opening as a feature request.
------------------------------------------------------------------------
[2002-11-08 03:59:26] tal@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2002-11-08 03:56:29] Otto.Stolz@uni-konstanz.de
parse_url('mailto:Otto.Stolz@uni-konstanz.de')
yields:
array( ['scheme'] => 'mailto'
['path'] => 'Otto.Stolz@uni-konstanz.de'
)
According
to <http://www.zvon.org/tmRFC/RFC2368/Output/chapter2.html>
and <http://www.zvon.org/tmRFC/RFC2822/Output/chapter3.html#sub4>,
it should rather yield:
array( ['scheme'] => 'mailto'
['host'] => 'uni-konstanz.de'
['user'] => 'Otto.Stolz'
)
A test page can be found at
<http://www.rz.uni-konstanz.de/Antivirus/tests/parse_url.php>,
the pertinent PHP source at
<http://www.rz.uni-konstanz.de/Antivirus/tests/parse_url.txt>.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20308&edit=1