summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchris <chris@jalakai.co.uk>2006-08-04 01:12:53 +0200
committerchris <chris@jalakai.co.uk>2006-08-04 01:12:53 +0200
commit8051891776ed644e1d7e8f8948850c8b04b07a45 (patch)
tree2a5f685624cbf37c5603cc4f116614e6b197b1ca
parentf255651baae501d4171f1e516445fbfbcb328327 (diff)
downloadrpg-8051891776ed644e1d7e8f8948850c8b04b07a45.tar.gz
rpg-8051891776ed644e1d7e8f8948850c8b04b07a45.tar.bz2
fix for php5's more stringent type checking in foreach (auth/mysql.class.php)
as described at http://wiki.splitbrain.org/wiki:auth:mysql#using_mysql_5 darcs-hash:20060803231253-9b6ab-bbf06ef1e9141c5ec1d3c79dad7f88481296ad8b.gz
-rw-r--r--inc/auth/mysql.class.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/inc/auth/mysql.class.php b/inc/auth/mysql.class.php
index da89dd845..aea11d35f 100644
--- a/inc/auth/mysql.class.php
+++ b/inc/auth/mysql.class.php
@@ -342,9 +342,11 @@ class auth_mysql extends auth_basic {
$sql .= " ".$this->cnf['SortOrder']." LIMIT $first, $limit";
$result = $this->_queryDB($sql);
- foreach ($result as $user)
- if (($info = $this->_getUserInfo($user['user'])))
- $out[$user['user']] = $info;
+ if (!empty($result)) {
+ foreach ($result as $user)
+ if (($info = $this->_getUserInfo($user['user'])))
+ $out[$user['user']] = $info;
+ }
$this->_unlockTables();
$this->_closeDB();