Re: Net_URL: default argument values override object properties in initialize()
| From: | spaze | Date: | Thu, 10 May 2007 22:45:30 +0000 |
| Subject: | Re: Net_URL: default argument values override object properties in initialize() | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-46727@lists.php.net to get a copy of this message | ||
Friday, May 11, 2007, 12:33:17 AM, you wrote:
> Your patch didn't make it to the list. Try attaching it with a
> text/plain mime type (.txt extension).
Oh well, thanks for noticing. Attaching as .txt this time.
As for the Net_URL2, in fact I'm a "secondary" user, I'm using
Mail_IMAPv2, which depends on Net_URL, so the switch is not as easy as
it may seem.
Thanks again.
--- URL.php-1.46 2007-05-10 23:26:05.624097600 +0200 +++ URL.php-1.46-spaze 2007-05-10 23:41:04.847116800 +0200 @@ -129,12 +129,10 @@ $this->initialize(); } - function initialize($url = null, $useBrackets = true) + function initialize() { $HTTP_SERVER_VARS = !empty($_SERVER) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; - $this->useBrackets = $useBrackets; - $this->url = $url; $this->user = ''; $this->pass = ''; $this->host = ''; @@ -144,7 +142,7 @@ $this->anchor = ''; // Only use defaults if not an absolute URL given - if (!preg_match('/^[a-z0-9]+:\/\//i', $url)) { + if (!preg_match('/^[a-z0-9]+:\/\//i', $this->url)) { $this->protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http'); /** @@ -169,8 +167,8 @@ } // Parse the url and store the various parts - if (!empty($url)) { - $urlinfo = parse_url($url); + if (!empty($this->url)) { + $urlinfo = parse_url($this->url); // Default querystring $this->querystring = array();
--- URL.php-1.46 2007-05-10 23:26:05.624097600 +0200 +++ URL.php-1.46-spaze 2007-05-10 23:41:04.847116800 +0200 @@ -129,12 +129,10 @@ $this->initialize(); } - function initialize($url = null, $useBrackets = true) + function initialize() { $HTTP_SERVER_VARS = !empty($_SERVER) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; - $this->useBrackets = $useBrackets; - $this->url = $url; $this->user = ''; $this->pass = ''; $this->host = ''; @@ -144,7 +142,7 @@ $this->anchor = ''; // Only use defaults if not an absolute URL given - if (!preg_match('/^[a-z0-9]+:\/\//i', $url)) { + if (!preg_match('/^[a-z0-9]+:\/\//i', $this->url)) { $this->protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http'); /** @@ -169,8 +167,8 @@ } // Parse the url and store the various parts - if (!empty($url)) { - $urlinfo = parse_url($url); + if (!empty($this->url)) { + $urlinfo = parse_url($this->url); // Default querystring $this->querystring = array();