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

Request #2824 error suppresion is used where code canbe easily changed to avoid errors
Submitted: 2004-11-24 22:35 UTC
From: alexei at net24 dot co dot nz Assigned:
Status: Closed Package: Net_URL
PHP Version: 5.0.2 OS: freebsd
Roadmaps: (Not assigned)    
Subscription  


 [2004-11-24 22:35 UTC] alexei at net24 dot co dot nz
Description: ------------ functions __construct and _parseRawQuerystring use error suppression (@) where code can be easily rewritten to avoid errors patch included Reproduce code: --------------- ? Net_URL.diff Index: URL.php =================================================================== RCS file: /repository/pear/Net_URL/URL.php,v retrieving revision 1.37 diff -u -r1.37 URL.php --- URL.php 26 Jun 2004 12:45:07 -0000 1.37 +++ URL.php 24 Nov 2004 22:21:06 -0000 @@ -125,7 +125,7 @@ // Only use defaults if not an absolute URL given if (!preg_match('/^[a-z0-9]+:\/\//i', $url)) { - $this->protocol = (@$_SERVER['HTTPS'] == 'on' ? 'https' : 'http'); + $this->protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http'); /** * Figure out host/port @@ -370,7 +370,7 @@ } if (substr($key, -2) == '[]') { $key = substr($key, 0, -2); - if (@!is_array($return[$key])) { + if (!isset($return[$key]) || !is_array($return[$key])) { $return[$key] = array(); $return[$key][] = $value; } else {

Comments

 [2005-03-02 03:10 UTC] richard
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.