|
List Info
Thread: Net_URL: default argument values override object properties in initialize()
|
|
| Net_URL: default argument values
override object properties in
initialize() |

|
2007-05-10 17:15:07 |
Hello,
sorry for writing to the list, I tried to report this on the
issue
tracker, but after submitting I got this message on the
website:
| ERROR:
| Critical internal error: could not send email to your
address
| <minehere>, please write a mail message to the
<i>pear-dev</i>mailing
| list and report this problem with details. We apologize
for the
| problem, your report will help us to fix it for future
users: No such
| handle found, cannot send confirmation email
Anyway, I have found and fixed issue/bug with default
argument values
overriding object properties in initialize() in the CVS
sources of
Net_URL (running PHP 5.2.1 on Win32 with CVS version of
Net_URL,
URL.php revision 1.45.)
Description:
Regarding the revision 1.45 of URL.php there's a showstopper
in initialize():
In __construct() you set the object properties and then call
the
initialize() method with no arguments:
$this->url = $url;
$this->useBrackets = $useBrackets;
$this->initialize();
But initialize() is declared with default argument values:
function initialize($url = null, $useBrackets = true)
and later you copy the arguments into object properties:
$this->useBrackets = $useBrackets;
$this->url = $url;
So the $url passed to the contructor is not taken into care
and the
defaults are used. Plus sometimes you refer to the function
argument
instead of the object property:
if (!preg_match('/^[a-z0-9]+:///i', $url)) {
In previous revisions (i.e. stable 1.36) everything works
fine.
Please find attached patch against 1.46 which fixes all the
problems,
thanks for reviewing.
Test code:
require_once 'Net/URL.php';
$dsn = 'imap://foo:bar mail.example.com:143/INBOX';
$net_url =& new Net_URL($dsn);
echo $net_url->host;
Expected result:
mail.example.com
Actual result:
localhost
Thanks.
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|
|
| Re: Net_URL: default argument values
override object properties in
initialize() |

|
2007-05-10 17:33:17 |
On 5/10/07, spaze <spaze-bugs exploited.cz> wrote:
> Hello,
>
> sorry for writing to the list, I tried to report this
on the issue
> tracker, but after submitting I got this message on the
website:
>
> | ERROR:
> | Critical internal error: could not send email to your
address
> | <minehere>, please write a mail message to the
<i>pear-dev</i>mailing
> | list and report this problem with details. We
apologize for the
> | problem, your report will help us to fix it for
future users: No such
> | handle found, cannot send confirmation email
>
> Anyway, I have found and fixed issue/bug with default
argument values
> overriding object properties in initialize() in the CVS
sources of
> Net_URL (running PHP 5.2.1 on Win32 with CVS version of
Net_URL,
> URL.php revision 1.45.)
>
>
> Description:
>
> Regarding the revision 1.45 of URL.php there's a
showstopper in initialize():
>
> In __construct() you set the object properties and then
call the
> initialize() method with no arguments:
>
> $this->url = $url;
> $this->useBrackets = $useBrackets;
>
> $this->initialize();
>
> But initialize() is declared with default argument
values:
>
> function initialize($url = null, $useBrackets =
true)
>
> and later you copy the arguments into object
properties:
>
> $this->useBrackets = $useBrackets;
> $this->url = $url;
>
> So the $url passed to the contructor is not taken into
care and the
> defaults are used. Plus sometimes you refer to the
function argument
> instead of the object property:
>
> if (!preg_match('/^[a-z0-9]+:///i', $url)) {
>
> In previous revisions (i.e. stable 1.36) everything
works fine.
>
> Please find attached patch against 1.46 which fixes all
the problems,
> thanks for reviewing.
>
Your patch didn't make it to the list. Try attaching it with
a
text/plain mime type (.txt extension).
--
Justin Patrin
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|
|
| Re: Net_URL: default argument values
override object properties in
initialize() |

|
2007-05-10 17:38:44 |
Also, since you are using PHP5, try upgrading to Net_URL2
which is the
PHP5 package.
On 5/10/07, Justin Patrin <papercrane gmail.com> wrote:
> On 5/10/07, spaze <spaze-bugs exploited.cz> wrote:
> > Hello,
> >
> > sorry for writing to the list, I tried to report
this on the issue
> > tracker, but after submitting I got this message
on the website:
> >
> > | ERROR:
> > | Critical internal error: could not send email to
your address
> > | <minehere>, please write a mail message to
the <i>pear-dev</i>mailing
> > | list and report this problem with details. We
apologize for the
> > | problem, your report will help us to fix it for
future users: No such
> > | handle found, cannot send confirmation email
> >
> > Anyway, I have found and fixed issue/bug with
default argument values
> > overriding object properties in initialize() in
the CVS sources of
> > Net_URL (running PHP 5.2.1 on Win32 with CVS
version of Net_URL,
> > URL.php revision 1.45.)
> >
> >
> > Description:
> >
> > Regarding the revision 1.45 of URL.php there's a
showstopper in initialize():
> >
> > In __construct() you set the object properties and
then call the
> > initialize() method with no arguments:
> >
> > $this->url = $url;
> > $this->useBrackets = $useBrackets;
> >
> > $this->initialize();
> >
> > But initialize() is declared with default argument
values:
> >
> > function initialize($url = null, $useBrackets =
true)
> >
> > and later you copy the arguments into object
properties:
> >
> > $this->useBrackets = $useBrackets;
> > $this->url = $url;
> >
> > So the $url passed to the contructor is not taken
into care and the
> > defaults are used. Plus sometimes you refer to the
function argument
> > instead of the object property:
> >
> > if (!preg_match('/^[a-z0-9]+:///i', $url)) {
> >
> > In previous revisions (i.e. stable 1.36)
everything works fine.
> >
> > Please find attached patch against 1.46 which
fixes all the problems,
> > thanks for reviewing.
> >
>
> Your patch didn't make it to the list. Try attaching it
with a
> text/plain mime type (.txt extension).
>
>
> --
> Justin Patrin
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub
.php
>
>
--
David Coallier,
Founder & Software Architect,
Agora Production (http://agoraproduction.com
)
51.42.06.70.18
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|
|
| Re: Net_URL: default argument values
override object properties in
initialize() |

|
2007-05-10 17:42:51 |
Yes I see the problem, could you please open a new bug ?
On 5/10/07, David Coallier <davidc php.net> wrote:
> Also, since you are using PHP5, try upgrading to
Net_URL2 which is the
> PHP5 package.
>
> On 5/10/07, Justin Patrin <papercrane gmail.com> wrote:
> > On 5/10/07, spaze <spaze-bugs exploited.cz> wrote:
> > > Hello,
> > >
> > > sorry for writing to the list, I tried to
report this on the issue
> > > tracker, but after submitting I got this
message on the website:
> > >
> > > | ERROR:
> > > | Critical internal error: could not send
email to your address
> > > | <minehere>, please write a mail
message to the <i>pear-dev</i>mailing
> > > | list and report this problem with details.
We apologize for the
> > > | problem, your report will help us to fix it
for future users: No such
> > > | handle found, cannot send confirmation
email
> > >
> > > Anyway, I have found and fixed issue/bug with
default argument values
> > > overriding object properties in initialize()
in the CVS sources of
> > > Net_URL (running PHP 5.2.1 on Win32 with CVS
version of Net_URL,
> > > URL.php revision 1.45.)
> > >
> > >
> > > Description:
> > >
> > > Regarding the revision 1.45 of URL.php
there's a showstopper in initialize():
> > >
> > > In __construct() you set the object
properties and then call the
> > > initialize() method with no arguments:
> > >
> > > $this->url = $url;
> > > $this->useBrackets =
$useBrackets;
> > >
> > > $this->initialize();
> > >
> > > But initialize() is declared with default
argument values:
> > >
> > > function initialize($url = null,
$useBrackets = true)
> > >
> > > and later you copy the arguments into object
properties:
> > >
> > > $this->useBrackets =
$useBrackets;
> > > $this->url = $url;
> > >
> > > So the $url passed to the contructor is not
taken into care and the
> > > defaults are used. Plus sometimes you refer
to the function argument
> > > instead of the object property:
> > >
> > > if (!preg_match('/^[a-z0-9]+:///i',
$url)) {
> > >
> > > In previous revisions (i.e. stable 1.36)
everything works fine.
> > >
> > > Please find attached patch against 1.46 which
fixes all the problems,
> > > thanks for reviewing.
> > >
> >
> > Your patch didn't make it to the list. Try
attaching it with a
> > text/plain mime type (.txt extension).
> >
> >
> > --
> > Justin Patrin
> >
> > --
> > PEAR Development Mailing List (http://pear.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub
.php
> >
> >
>
>
> --
> David Coallier,
> Founder & Software Architect,
> Agora Production (http://agoraproduction.com
)
> 51.42.06.70.18
>
--
David Coallier,
Founder & Software Architect,
Agora Production (http://agoraproduction.com
)
51.42.06.70.18
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|
|
| Re: Net_URL: default argument values
override object properties in
initialize() |

|
2007-05-10 17:45:30 |
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.
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|
|
|
| Re: Net_URL: default argument values
override object properties in
initialize() |

|
2007-05-10 17:55:40 |
Friday, May 11, 2007, 12:42:51 AM, you wrote:
> Yes I see the problem, could you please open a new bug
?
Here it comes: http://pear.php.net/bu
gs/11008
Thanks
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|
|
[1-6]
|
|