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
This commit is contained in:
nikrou 2010-05-24 20:44:55 +00:00
parent f010502f12
commit 01788faeb5
3 changed files with 9 additions and 9 deletions

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}