From af9b8303d60eedfb1821de0bf000988f96a63fc6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 24 Jun 2014 07:25:35 +0000 Subject: [PATCH] make egw_db::from_bool() static and use that to work around PHP 5.3 limitation of not making class scope available in closures --- phpgwapi/inc/class.egw_customfields.inc.php | 2 +- phpgwapi/inc/class.egw_db.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.egw_customfields.inc.php b/phpgwapi/inc/class.egw_customfields.inc.php index ca10ae2b43..fc3a89c7d1 100755 --- a/phpgwapi/inc/class.egw_customfields.inc.php +++ b/phpgwapi/inc/class.egw_customfields.inc.php @@ -92,7 +92,7 @@ class egw_customfields implements IteratorAggregate $row['private'] = $row['private'] ? explode(',', $row['private']) : array(); $row['type2'] = $row['type2'] ? explode(',', $row['type2']) : array(); $row['values'] = json_decode($row['values'], true); - $row['needed'] = self::$db->from_bool($row['needed']); + $row['needed'] = egw_db::from_bool($row['needed']); return $row; }, array(), function($row) diff --git a/phpgwapi/inc/class.egw_db.inc.php b/phpgwapi/inc/class.egw_db.inc.php index 7950132f50..ef9f4f27c7 100644 --- a/phpgwapi/inc/class.egw_db.inc.php +++ b/phpgwapi/inc/class.egw_db.inc.php @@ -592,7 +592,7 @@ class egw_db * @param string $val boolean value in db-specfic notation * @return boolean */ - function from_bool($val) + public static function from_bool($val) { return $val && $val[0] !== 'f'; // everthing other then 0 or f[alse] is returned as true }