Issues

ZF2-69: exception 'Zend\Http\Exception\InvalidArgumentException' with message 'Invalid URI passed as string' in vendor/Zend/library/Zend/Http/Request.php:176

Issue Type: Bug Created: 2011-09-17T18:39:48.000+0000 Last Updated: 2012-06-06T16:30:13.000+0000 Status: Resolved Fix version(s): Reporter: Stephan Petzl (stoefln) Assignee: Ralph Schindler (ralph) Tags: - Zend\Http

Related issues: Attachments:

Description

While running tests with http client, i got this error, when browsing to urls which contain a "#". Seems like this was introduced in the last weeks, since it worked before updating today...

Let me know if you need some more infos...

Comments

Posted by Denis Portnov (denix) on 2012-02-24T17:09:17.000+0000

I confirm, URI with fragment

<pre class="highlight">
$req = new \Zend\Http\Request();
$req->setUri('<a href="http://somedomain.com/base/base1/file.html#12">http://somedomain.com/base/base1/file.html#12</a>');
echo $req, "\n";

raises exception

<pre class="literal"> 
Fatal error: Uncaught exception 'Zend\Http\Exception\InvalidArgumentException' with message 'Invalid URI passed as string' in /home/devel/zf2-devel/zf2/library/Zend/Http/Request.php:177
Stack trace:
#0 /home/devel/zf2-devel/zf2/tmp/uri.php(6): Zend\Http\Request->setUri('<a href="http://somedoma">http://somedoma</a>...')
#1 {main}
  thrown in /home/devel/zf2-devel/zf2/library/Zend/Http/Request.php on line 177

without fragment

<pre class="highlight">
$req = new \Zend\Http\Request();
$req->setUri('<a href="http://somedomain.com/base/base1/file.html">http://somedomain.com/base/base1/file.html</a>');
echo $req, "\n";

everything is fine

<pre class="literal"> 
GET <a href="http://somedomain.com/base/base1/file.html">http://somedomain.com/base/base1/file.html</a> HTTP/1.1

Posted by Maks 3w (maks3w) on 2012-06-06T16:30:13.000+0000

I tried the example and works well for me.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts