From f62929576d1aee471c951f912dda17a2c94152dd Mon Sep 17 00:00:00 2001 From: James Sansbury Date: Tue, 28 Aug 2012 14:27:32 -0400 Subject: [PATCH] Issue #1760752: Do not assume all tiny ints are boolean values when exporting. --- includes/export.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/export.inc b/includes/export.inc index 6a76fbd..6cea772 100644 --- a/includes/export.inc +++ b/includes/export.inc @@ -1169,7 +1169,11 @@ function ctools_export_object($table, $object, $indent = '', $identifier = NULL, else { $value = $object->$field; if ($info['type'] == 'int') { - $value = (isset($info['size']) && $info['size'] == 'tiny') ? (bool) $value : (int) $value; + // Ensure that the value is cast as an int, so that integer values are + // not exported as strings. This could cause problems if this field is + // being used as a storage for boolean values, where the string '0' + // might get evaluated as boolean TRUE in the application logic. + $value = (int) $value; } $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . ";\n"; -- 1.7.10.4