diff options
author | nikrou <nikrou@piwigo.org> | 2010-05-24 20:44:55 +0000 |
---|---|---|
committer | nikrou <nikrou@piwigo.org> | 2010-05-24 20:44:55 +0000 |
commit | 01788faeb50cca9a18ddd5b132dd41c9494d6355 (patch) | |
tree | 62439bf1c373b099741a8f9f6b6d9397a23432d1 /include | |
parent | f010502f126df59ef7d9bff518376d534a0def74 (diff) |
Fix bug 1695 : incorrect boolean to string conversion for SQLite and PostgreSQL database engines merge from trunk
git-svn-id: http://piwigo.org/svn/branches/2.1@6342 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r-- | include/dblayer/functions_pdo-sqlite.inc.php | 6 | ||||
-rw-r--r-- | include/dblayer/functions_pgsql.inc.php | 6 | ||||
-rw-r--r-- | include/dblayer/functions_sqlite.inc.php | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/include/dblayer/functions_pdo-sqlite.inc.php b/include/dblayer/functions_pdo-sqlite.inc.php index a4c3881f0..a1f0a7833 100644 --- a/include/dblayer/functions_pdo-sqlite.inc.php +++ b/include/dblayer/functions_pdo-sqlite.inc.php @@ -467,13 +467,13 @@ function get_boolean( $string ) */ function boolean_to_string($var) { - if (!empty($var) && ($var == 'true')) + if (is_bool($var)) { - return 'true'; + return $var ? 'true' : 'false'; } else { - return 'false'; + return $var; } } diff --git a/include/dblayer/functions_pgsql.inc.php b/include/dblayer/functions_pgsql.inc.php index 5e05fb16a..38fcc2ed9 100644 --- a/include/dblayer/functions_pgsql.inc.php +++ b/include/dblayer/functions_pgsql.inc.php @@ -510,13 +510,13 @@ function get_boolean( $string ) */ function boolean_to_string($var) { - if (!empty($var) && ($var == 't')) + if (is_bool($var)) { - return 'true'; + return $var ? 'true' : 'false'; } else { - return 'false'; + return $var; } } diff --git a/include/dblayer/functions_sqlite.inc.php b/include/dblayer/functions_sqlite.inc.php index 1b34d3fcb..9de81868d 100644 --- a/include/dblayer/functions_sqlite.inc.php +++ b/include/dblayer/functions_sqlite.inc.php @@ -479,13 +479,13 @@ function get_boolean( $string ) */ function boolean_to_string($var) { - if (!empty($var) && ($var == 'true')) + if (is_bool($var)) { - return 'true'; + return $var ? 'true' : 'false'; } else { - return 'false'; + return $var; } } |