[fusion-commits] r1457 - trunk/common/php
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Tue Aug 12 16:08:17 EDT 2008
Author: madair
Date: 2008-08-12 16:08:17 -0400 (Tue, 12 Aug 2008)
New Revision: 1457
Modified:
trunk/common/php/Xml2JSON.php
Log:
closes #95: replace \n in XML responses
Modified: trunk/common/php/Xml2JSON.php
===================================================================
--- trunk/common/php/Xml2JSON.php 2008-08-12 19:58:27 UTC (rev 1456)
+++ trunk/common/php/Xml2JSON.php 2008-08-12 20:08:17 UTC (rev 1457)
@@ -38,8 +38,10 @@
header('Content-type: text/plain');
header('X-JSON: true');
$xml = rawurldecode ($REQUEST_VARS['xml']);
+ $xml = trim($xml);
$xml = str_replace('\"', '"', $xml);
$xml = str_replace('"', "'", $xml);
+ $xml = preg_replace('/\n/', ' ', $xml);
} elseif (isset($argv)) {
$cliArgs = arguments($argv);
if (isset($cliArgs['obj'])) {
@@ -57,7 +59,9 @@
} else {
die('no XML input');
}
+//echo "/*";
//print_r($xml);
+//echo "*/";
$document = DOMDocument::loadXML($xml);
if ($document == null) {
die ('/* invalid xml document:'.$xml.' */');
More information about the fusion-commits
mailing list