AddressBook::full_address() should not be called statically ...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

AddressBook::full_address() should not be called statically ...

Paul Lesniewski
NOTE:  SourceForge is currently having problems with their mailing
lists.  This is a message originally from Juergen Nickelsen sent on
Tue, 13 Jan 2015 15:22:43 +0100
=====

Recently we moved our SquirrelMail installation from Debian Squeeze to
Wheezy, which implies a move from PHP 5.3 to PHP 5.4. The latter is
probably the reason that the error log is now swamped by messages like
this one:

[Mon Jan 12 17:31:00 2015] [error] [client 172.19.10.20] PHP Strict
Standards:  Non-static method AddressBook::full_address() should not be
called statically in
/home/webmail/public_html/src/addrbook_search_html.php on line 129,
referer:
https://webmail.zedat.fu-berlin.de/src/compose.php?mailbox=3DINBOX&startM=
essage=3D1

(Technically, the size of the error log doesn't matter so much, but I
don't really like it that other, maybe more interesting error messages
are obscured by a high number of these.)

Now I am not a real PHP programmer, but when I look at that method and
the places where it is called, it seems like it can or even *should*
actually be a static method, as it does not use $this at all.

So I tried and made the method static, and all places where the method
is called still seem to work as intended.

Is this maybe the way to go? Any objections? What will break when I put
this change into production?

Best regards,
J=C3=BCrgen.

--=20
<[hidden email]> Tel +49.30.838-50740 Fax -450740
Zentraleinrichtung fuer Datenverarbeitung, Central Systems (Unix)
Freie Universitaet Berlin, Fabeckstrasse 32, 14195 Berlin, DE

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [hidden email]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
Reply | Threaded
Open this post in threaded view
|

Re: AddressBook::full_address() should not be called statically ...

Paul Lesniewski
> [Mon Jan 12 17:31:00 2015] [error] [client 172.19.10.20] PHP Strict
> Standards:  Non-static method AddressBook::full_address() should not be
> called statically in
> /home/webmail/public_html/src/addrbook_search_html.php on line 129,
> referer:
> https://webmail.zedat.fu-berlin.de/src/compose.php?mailbox=3DINBOX&startM=
> essage=3D1
>
> Now I am not a real PHP programmer, but when I look at that method and
> the places where it is called, it seems like it can or even *should*
> actually be a static method, as it does not use $this at all.

I don't know if this method was originally designed to be called
externally, but you're right that it is fine being defined as static
and since it's being called statically from elsewhere, we should
declare it that way.  Change committed.  Thanks!

--
Paul Lesniewski
SquirrelMail Team
Please support Open Source Software by donating to SquirrelMail!
http://squirrelmail.org/donate_paul_lesniewski.php

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [hidden email]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users