From: <wis...@us...> - 2012-05-14 06:19:02
|
Revision: 9505 http://xoops.svn.sourceforge.net/xoops/?rev=9505&view=rev Author: wishcraft Date: 2012-05-14 06:18:55 +0000 (Mon, 14 May 2012) Log Message: ----------- Xortify Server 2.06 (RC) - Structural and Functional changes to Xortify Server - Contact wishcraft for guides on setting up cloud server. (XML API Fixed) Modified Paths: -------------- XoopsModules/xortify/cloud/2.06/htdocs/modules/xxml/include/server.php Modified: XoopsModules/xortify/cloud/2.06/htdocs/modules/xxml/include/server.php =================================================================== --- XoopsModules/xortify/cloud/2.06/htdocs/modules/xxml/include/server.php 2012-05-14 05:46:11 UTC (rev 9504) +++ XoopsModules/xortify/cloud/2.06/htdocs/modules/xxml/include/server.php 2012-05-14 06:18:55 UTC (rev 9505) @@ -18,8 +18,8 @@ } -if (!function_exists("xortify_xml2array")) { - function xortify_xml2array($contents, $get_attributes=1, $priority = 'tag') { +if (!function_exists("xxml_xml2array")) { + function xxml_xml2array($contents, $get_attributes=1, $priority = 'tag') { if(!$contents) return array(); if(!function_exists('xml_parser_create')) { @@ -143,7 +143,7 @@ } } -function xortifyserver_toXML($array, $name='array', $standalone=TRUE, $beginning=TRUE, $nested = 0) +function xxml_toXML($array, $name='array', $standalone=TRUE, $beginning=TRUE, $nested = 0) { if ($beginning) { if ($standalone) @@ -159,13 +159,13 @@ if (is_array($value)) { $output .= str_repeat("\t", (1 * $nested)) . '<' . (is_string($key) ? $key : $name.'_' . $key) . '>' . "\n"; $nested++; - $output .= xortify_toXML($value, $name, false, false, $nested++); + $output .= xxml_toXML($value, $name, false, false, $nested); $nested--; $output .= str_repeat("\t", (1 * $nested)) . '</' . (is_string($key) ? $key : $name.'_' . $key) . '>' . "\n"; } else { if (strlen($value)>0) { $nested++; - $output .= str_repeat("\t", (1 * $nested)) . ' <' . (is_string($key) ? $key : $name.'_' . $key) . '>' . trim($value) . '</' . (is_string($key) ? $key : $name.'_' . $key) . '>' . "\n"; + $output .= str_repeat("\t", (1 * $nested)) . ' <' . (is_string($key) ? $key : $name.'_' . $key) . '>' . trim(htmlspecialchars($value)) . '</' . (is_string($key) ? $key : $name.'_' . $key) . '>' . "\n"; $nested--; } } @@ -173,7 +173,7 @@ } } elseif (strlen($array)>0) { $nested++; - $output .= str_repeat("\t", (1 * $nested)) . trim($array) ."\n"; + $output .= str_repeat("\t", (1 * $nested)) . trim(htmlspecialchars($array)) ."\n"; $nested--; } @@ -213,13 +213,14 @@ foreach($FunctionDefine as $id => $func) { if (!empty($_REQUEST[$func])) { + $elename .= (strlen($elename)>0)?'_'.$func:''.$func; $opfunc = $func; $xsd = $func.'_xsd'; $opxsd = $xsd(); if (class_exists('SimpleXMLElement')) $opdata = obj2array(new SimpleXMLElement(str_replace('\\"', '"', $_REQUEST[$func]))); elseif(!function_exists('xml_parser_create')) { - $opdata = xortify_xml2array(str_replace('\\"', '"', $_REQUEST[$func]), true); + $opdata = xxml_xml2array(str_replace('\\"', '"', $_REQUEST[$func]), true); $opdata = $opdata[$func]; } @@ -317,15 +318,14 @@ XoopsCache::write('xxml_'.$opfunc.'_'.sha1(implode(':', $opdata)), $result, $GLOBALS['xoopsModuleConfig']['function_cache']); } $ttlresult = array_merge($ttlresult, $result); - $elename .= (strlen($elename)>0)?'_'.$func:''.$func; } else { $ttlresult = array_merge($ttlresult, $result); - $elename .= (strlen($elename)>0)?'_'.$func:''.$func; } } } -echo xortifyserver_toXML($ttlresult, $elename, true); +echo xxml_toXML($ttlresult, $elename, true); + $xoopsPreload =& XoopsPreload::getInstance(); $xoopsPreload->triggerEvent('api.server.end'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |