X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fabook_database.php;h=45c2146d5f80259360a16316f78df0d77a1e3f28;hb=c71c845ce8a5f100f9b072a6143c8adfa3df7470;hp=06eda0c64b561329f8a5b2ead7e0ae747a6a0732;hpb=466abb9c6e2d59218590a4733bde321b6e20c2f8;p=squirrelmail.git diff --git a/functions/abook_database.php b/functions/abook_database.php index 06eda0c6..45c2146d 100644 --- a/functions/abook_database.php +++ b/functions/abook_database.php @@ -14,7 +14,7 @@ * PRIMARY KEY (owner,nickname) * * - * @copyright 1999-2016 The SquirrelMail Project Team + * @copyright 1999-2020 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -147,10 +147,10 @@ class abook_database extends addressbook_backend { /* ========================== Private ======================= */ /** - * Constructor + * Constructor (PHP5 style, required in some future version of PHP) * @param array $param address book backend options */ - function abook_database($param) { + function __construct($param) { $this->sname = _("Personal Address Book"); /* test if PDO or Pear DB classes are available and freak out if necessary */ @@ -206,6 +206,13 @@ class abook_database extends addressbook_backend { } } + /** + * Constructor (PHP4 style, kept for compatibility reasons) + * @param array $param address book backend options + */ + function abook_database($param) { + return self::__construct($param); + } /** * Open the database. @@ -674,7 +681,7 @@ class abook_database extends addressbook_backend { $sepstr = ''; $where_clause = ''; $where_clause_args = array(); - while (list($undef, $nickname) = each($alias)) { + foreach ($alias as $nickname) { $where_clause .= $sepstr . $this->identifier_quote_char . 'nickname' . $this->identifier_quote_char . ' = ?'; $where_clause_args[] = $nickname; $sepstr = ' OR '; @@ -698,7 +705,7 @@ class abook_database extends addressbook_backend { $this->table, $this->owner); $sepstr = ''; - while (list($undef, $nickname) = each($alias)) { + foreach ($alias as $nickname) { $query .= sprintf("%s nickname='%s' ", $sepstr, $this->dbh->quoteString($nickname)); $sepstr = 'OR';