From 5abd04902b11472cd8243280f0c08687325c5e90 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 27 Sep 2006 01:54:01 +0000 Subject: --- system/database/DB_export.php | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) (limited to 'system/database') diff --git a/system/database/DB_export.php b/system/database/DB_export.php index 8d6446cb6..a2e3e3e4c 100644 --- a/system/database/DB_export.php +++ b/system/database/DB_export.php @@ -112,8 +112,11 @@ class CI_DB_export { // Create variables for convenience extract($params); + // Load the xml helper + $obj =& get_instance(); + $obj->load->helper('xml'); + // Generate the result - $xml = "<{$root}/>".$newline; foreach ($query->result_array() as $row) { @@ -121,7 +124,7 @@ class CI_DB_export { foreach ($row as $key => $val) { - $xml .= $tab.$tab."<{$key}>".$this->_xml_convert($val)."".$newline; + $xml .= $tab.$tab."<{$key}>".xml_convert($val)."".$newline; } $xml .= $tab."".$newline; } @@ -130,33 +133,6 @@ class CI_DB_export { return $xml; } - - // ------------------------------------------------------------------------ - - /** - * Convert Reserved XML characters to Entities - * - * @access public - * @param string - * @return string - */ - function _xml_convert($str) - { - $temp = '__TEMP_AMPERSANDS'; - - $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); - $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); - - $str = str_replace(array("&","<",">","\"", "'", "-"), - array("&", "<", ">", """, "'", "-"), - $str); - - $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); - $str = preg_replace("/$temp(\w+);/","&\\1;", $str); - - return $str; - } - } ?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b