1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 19:30:25 +02:00

Fix for importing/exporting polls and ratings which use chr(1)

This commit is contained in:
Cameron
2017-12-17 08:49:17 -08:00
parent c1d23f34c8
commit 0c1bbbd5c8

View File

@@ -834,7 +834,7 @@ class xmlClass
* @param string $key key for the current value. Used for exception processing.
* @return mixed
*/
private function e107ExportValue($val, $key = '')
public function e107ExportValue($val, $key = '')
{
if($key && isset($this->filePathPrepend[$key]))
{
@@ -860,6 +860,10 @@ class xmlClass
return "<![CDATA[". $val."]]>";
}
$val = str_replace(chr(1),'{\u0001}',$val);
return $val;
}
@@ -1093,7 +1097,7 @@ class xmlClass
{
//$message = print_r($xmlArray);
echo "<pre>".var_export($xmlArray,TRUE)."</pre>";
return;
return null;
}
$ret = array();
@@ -1179,7 +1183,7 @@ class xmlClass
foreach($item['field'] as $f)
{
$fieldkey = $f['@attributes']['name'];
$fieldval = (isset($f['@value'])) ? $f['@value'] : "";
$fieldval = (isset($f['@value'])) ? $this->e107ImportValue($f['@value']) : "";
$insert_array[$fieldkey] = $fieldval;
@@ -1212,6 +1216,14 @@ class xmlClass
}
function e107ImportValue($val)
{
$val = str_replace('{\u0001}', chr(1), $val);
return $val;
}
function getErrors($xml)
{
libxml_use_internal_errors(true);