[mapguide-commits] r6242 - trunk/MgDev/Web/src/schemareport
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Nov 22 02:50:47 EST 2011
Author: sparkliu
Date: 2011-11-21 23:50:47 -0800 (Mon, 21 Nov 2011)
New Revision: 6242
Modified:
trunk/MgDev/Web/src/schemareport/displayschema.php
Log:
Fix ticket #1864 - Incorrect schema name in schema report when feature class / schema name begins with number
This is because FDO has two encoding way for name: "-x00-" and "_x00-". When a character is the first character, it will use the latter one. Otherwise, it will use the former one. However, schema report only decodes the former one.
This fix adds the decoding for latter rule.
Modified: trunk/MgDev/Web/src/schemareport/displayschema.php
===================================================================
--- trunk/MgDev/Web/src/schemareport/displayschema.php 2011-11-22 06:32:01 UTC (rev 6241)
+++ trunk/MgDev/Web/src/schemareport/displayschema.php 2011-11-22 07:50:47 UTC (rev 6242)
@@ -69,12 +69,14 @@
// particular string while the rest of the encoded chars are translated properly.
$subXml = substr($xml, strpos($xml, 'xs:element'), -1);
$subXml = preg_replace("/-x([A-Za-z0-9]{1,4})-/e", "html_entity_decode('&#'.hexdec('$1').';',ENT_NOQUOTES,'UTF-8')", $subXml);
+ $subXml = preg_replace("/_x([A-Za-z0-9]{1,4})-/e", "html_entity_decode('&#'.hexdec('$1').';',ENT_NOQUOTES,'UTF-8')", $subXml);
$xml = substr_replace($xml, $subXml, strpos($xml, 'xs:element'), -1);
$nameSpaceStart = strpos($xml, 'targetNamespace="');
$nameSpaceEnd = strpos($xml, '"', $nameSpaceStart+17);
$nameSpace = substr($xml, $nameSpaceStart, $nameSpaceEnd-$nameSpaceStart);
$nameSpaceModified = preg_replace("/-x([A-Za-z0-9]{1,4})-/e", "html_entity_decode('&#'.hexdec('$1').';',ENT_NOQUOTES,'UTF-8')", $nameSpace);
+ $nameSpaceModified = preg_replace("/_x([A-Za-z0-9]{1,4})-/e", "html_entity_decode('&#'.hexdec('$1').';',ENT_NOQUOTES,'UTF-8')", $nameSpace);
$xml = str_replace($nameSpace, $nameSpaceModified, $xml);
$xml = preg_replace("/-x([A-Za-z0-9]{1,4})-/e", "'$1'", $xml);
More information about the mapguide-commits
mailing list