Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.1

Bug #13903 Incorrect detection in meta refresh response
Submitted: 2008-05-14 21:42 UTC
From: gemal Assigned: avb
Status: Closed Package: HTTP_Client (version 1.1.1)
PHP Version: 5.2.6 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2008-05-14 21:42 UTC] gemal (Henrik Gemal)
Description: ------------ if you have a meta refresh that looks like this: <meta http-equiv="refresh" content="0; url='/test/httpclientmeta.html'"> located on this server: http://gemal.dk/test/httpclientmeta.html then the meta refresh is going to be matches as: Array ( [0] => <meta http-equiv="refresh" content="0; url='/test/httpclientmeta.html'"> [1] => http-equiv="refresh" content="0; url='/test/httpclientmeta.html'" [2] => "refresh" ) ret=http://gemal.dk/test/'/test/httpclientmeta.html' note the ' in the url!!!

Comments

 [2008-05-15 21:01 UTC] gemal (Henrik Gemal)
changing line 573 to: if (empty($parts[1]) || !preg_match('/url\\s*=\\s*\'?(\\S+)(?<!\')/is', $parts[1], $urlMatches)) { seems to fix the problem
 [2008-05-22 20:10 UTC] gemal (Henrik Gemal)
should I produce a patch to get this one fixed?
 [2008-05-24 08:09 UTC] doconnor (Daniel O'Connor)
Henrik, that's certainly a good idea.
 [2008-05-25 11:57 UTC] gemal (Henrik Gemal)
I'm unable to attach the patch as a file due to insufficient priviliages so: Index: Client.php =================================================================== RCS file: /repository/pear/HTTP_Client/Client.php,v retrieving revision 1.8 diff -u -i -w -r1.8 Client.php --- Client.php 19 May 2007 14:57:31 -0000 1.8 +++ Client.php 25 May 2008 11:45:13 -0000 @@ -570,7 +570,7 @@ } $parts = explode(';', ('\'' == substr($urlMatches[1], 0, 1) || '"' == substr($urlMatches[1], 0, 1))? substr($urlMatches[1], 1, -1): $urlMatches[1]); - if (empty($parts[1]) || !preg_match('/url\\s*=\\s*(\\S+)/is', $parts[1], $urlMatches)) { + if (empty($parts[1]) || !preg_match('/url\\s*=\\s*\'?(\\S+)(?<!\')/is', $parts[1], $urlMatches)) { return null; } // We do finally have an url... Now check that it's:
 [2008-08-04 08:54 UTC] gemal (Henrik Gemal)
I have attached a patch but nothing happend :(
 [2008-10-11 11:26 UTC] avb (Alexey Borzov)
Looks like that it can also be <meta http-equiv='refresh' content='0; url="/foo.html"'> Will have to address all cases.
 [2008-10-11 11:43 UTC] avb (Alexey Borzov)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.