mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Fix for importing/exporting polls and ratings which use chr(1)
This commit is contained in:
@@ -834,7 +834,7 @@ class xmlClass
|
|||||||
* @param string $key key for the current value. Used for exception processing.
|
* @param string $key key for the current value. Used for exception processing.
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
private function e107ExportValue($val, $key = '')
|
public function e107ExportValue($val, $key = '')
|
||||||
{
|
{
|
||||||
if($key && isset($this->filePathPrepend[$key]))
|
if($key && isset($this->filePathPrepend[$key]))
|
||||||
{
|
{
|
||||||
@@ -860,6 +860,10 @@ class xmlClass
|
|||||||
return "<![CDATA[". $val."]]>";
|
return "<![CDATA[". $val."]]>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$val = str_replace(chr(1),'{\u0001}',$val);
|
||||||
|
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1093,7 +1097,7 @@ class xmlClass
|
|||||||
{
|
{
|
||||||
//$message = print_r($xmlArray);
|
//$message = print_r($xmlArray);
|
||||||
echo "<pre>".var_export($xmlArray,TRUE)."</pre>";
|
echo "<pre>".var_export($xmlArray,TRUE)."</pre>";
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
@@ -1179,7 +1183,7 @@ class xmlClass
|
|||||||
foreach($item['field'] as $f)
|
foreach($item['field'] as $f)
|
||||||
{
|
{
|
||||||
$fieldkey = $f['@attributes']['name'];
|
$fieldkey = $f['@attributes']['name'];
|
||||||
$fieldval = (isset($f['@value'])) ? $f['@value'] : "";
|
$fieldval = (isset($f['@value'])) ? $this->e107ImportValue($f['@value']) : "";
|
||||||
|
|
||||||
$insert_array[$fieldkey] = $fieldval;
|
$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)
|
function getErrors($xml)
|
||||||
{
|
{
|
||||||
libxml_use_internal_errors(true);
|
libxml_use_internal_errors(true);
|
||||||
|
Reference in New Issue
Block a user