Fix autodetection of numeric fields

This commit is contained in:
Nathan Gray 2011-03-29 17:46:07 +00:00
parent ccfe337f1e
commit 9056a41ebf

View File

@ -522,6 +522,9 @@ abstract class bo_merge
} }
if ($is_xml) // zip'ed xml document (eg. OO) if ($is_xml) // zip'ed xml document (eg. OO)
{ {
// Numeric fields
$names = array();
// clean replacements from array values and html or html-entities, which mess up xml // clean replacements from array values and html or html-entities, which mess up xml
foreach($replacements as $name => &$value) foreach($replacements as $name => &$value)
{ {
@ -557,9 +560,8 @@ abstract class bo_merge
} }
// Look for numbers, set their value if needed // Look for numbers, set their value if needed
$format = $replacement = ''; $format = $replacement = '';
if($this->numeric_fields) if($this->numeric_fields || count($names))
{ {
$names = array();
foreach($this->numeric_fields as $fieldname) { foreach($this->numeric_fields as $fieldname) {
$names[] = preg_quote($fieldname,'/'); $names[] = preg_quote($fieldname,'/');
} }