[fusion-commits] r2327 - branches/fusion-2.2/layers/MapGuide/php sandbox/adsk/2.3r/layers/MapGuide/php trunk/layers/MapGuide/php

svn_fusion at osgeo.org svn_fusion at osgeo.org
Mon Jan 24 04:54:18 EST 2011


Author: liuar
Date: 2011-01-24 01:54:18 -0800 (Mon, 24 Jan 2011)
New Revision: 2327

Modified:
   branches/fusion-2.2/layers/MapGuide/php/Legend.php
   sandbox/adsk/2.3r/layers/MapGuide/php/Legend.php
   trunk/layers/MapGuide/php/Legend.php
Log:
Fix ticket #431 Accented characters in layer legend label cause XML parser error in Legend.php



Modified: branches/fusion-2.2/layers/MapGuide/php/Legend.php
===================================================================
--- branches/fusion-2.2/layers/MapGuide/php/Legend.php	2011-01-24 08:55:25 UTC (rev 2326)
+++ branches/fusion-2.2/layers/MapGuide/php/Legend.php	2011-01-24 09:54:18 UTC (rev 2327)
@@ -68,7 +68,7 @@
 
     echo '<layer>';
     echo '<uniqueid>'.$layer->GetObjectId().'</uniqueid>';
-    echo '<layername>'.htmlentities($layer->GetName()).'</layername>';
+    echo '<layername>'.htmlspecialchars($layer->GetName()).'</layername>';
     echo '<layertype>'.$layer->GetLayerType().'</layertype>';
     echo '<displayinlegend>'.BooleanToString($layer->GetDisplayInLegend()).'</displayinlegend>';
     echo '<expandinlegend>'.BooleanToString($layer->GetExpandInLegend()).'</expandinlegend>';
@@ -76,7 +76,7 @@
     if ($layer->GetGroup()) {
         echo '<parentgroup>'.$layer->GetGroup()->GetObjectId().'</parentgroup>';
     }
-    echo '<legendlabel>'.htmlentities($layer->GetLegendLabel()).'</legendlabel>';
+    echo '<legendlabel>'.htmlspecialchars($layer->GetLegendLabel()).'</legendlabel>';
     echo '<selectable>'.BooleanToString($layer->GetSelectable()).'</selectable>';
     echo '<visible>'.BooleanToString($layer->GetVisible()).'</visible>';
     echo '<actuallyvisible>'.BooleanToString($layer->isVisible()).'</actuallyvisible>';
@@ -93,8 +93,8 @@
     $group=$groups->GetItem($i);
     $layerDefinition = $layer->GetLayerDefinition();
     echo '<group>';
-    echo '<groupname>'.htmlentities($group->GetName()).'</groupname>';
-    echo '<legendlabel>'.htmlentities($group->GetLegendLabel()).'</legendlabel>';
+    echo '<groupname>'.htmlspecialchars($group->GetName()).'</groupname>';
+    echo '<legendlabel>'.htmlspecialchars($group->GetLegendLabel()).'</legendlabel>';
     echo '<uniqueid>'.$group->GetObjectId().'</uniqueid>';
     echo '<displayinlegend>'.BooleanToString($group->GetDisplayInLegend()).'</displayinlegend>';
     echo '<expandinlegend>'.BooleanToString($group->GetExpandInLegend()).'</expandinlegend>';
@@ -168,8 +168,8 @@
                     $labelText = $label->length==1? $label->item(0)->nodeValue: "";
                     $filterText = $filter->length==1? $filter->item(0)->nodeValue: "";
                     $output .= '<styleitem>';
-                    $output .= '<label>'.htmlentities(trim($labelText)).'</label>';
-                    $output .= '<filter>'.htmlentities(trim($filterText)).'</filter>';
+                    $output .= '<label>'.htmlspecialchars(trim($labelText)).'</label>';
+                    $output .= '<filter>'.htmlspecialchars(trim($filterText)).'</filter>';
                     $output .= '<geomtype>'.($ts+1).'</geomtype>';
                     $output .= '<categoryindex>'.($catIndex++).'</categoryindex>';
                     $output .= '</styleitem>';

Modified: sandbox/adsk/2.3r/layers/MapGuide/php/Legend.php
===================================================================
--- sandbox/adsk/2.3r/layers/MapGuide/php/Legend.php	2011-01-24 08:55:25 UTC (rev 2326)
+++ sandbox/adsk/2.3r/layers/MapGuide/php/Legend.php	2011-01-24 09:54:18 UTC (rev 2327)
@@ -68,7 +68,7 @@
 
     echo '<layer>';
     echo '<uniqueid>'.$layer->GetObjectId().'</uniqueid>';
-    echo '<layername>'.htmlentities($layer->GetName()).'</layername>';
+    echo '<layername>'.htmlspecialchars($layer->GetName()).'</layername>';
     echo '<layertype>'.$layer->GetLayerType().'</layertype>';
     echo '<displayinlegend>'.BooleanToString($layer->GetDisplayInLegend()).'</displayinlegend>';
     echo '<expandinlegend>'.BooleanToString($layer->GetExpandInLegend()).'</expandinlegend>';
@@ -76,7 +76,7 @@
     if ($layer->GetGroup()) {
         echo '<parentgroup>'.$layer->GetGroup()->GetObjectId().'</parentgroup>';
     }
-    echo '<legendlabel>'.htmlentities($layer->GetLegendLabel()).'</legendlabel>';
+    echo '<legendlabel>'.htmlspecialchars($layer->GetLegendLabel()).'</legendlabel>';
     echo '<selectable>'.BooleanToString($layer->GetSelectable()).'</selectable>';
     echo '<visible>'.BooleanToString($layer->GetVisible()).'</visible>';
     echo '<actuallyvisible>'.BooleanToString($layer->isVisible()).'</actuallyvisible>';
@@ -93,8 +93,8 @@
     $group=$groups->GetItem($i);
     $layerDefinition = $layer->GetLayerDefinition();
     echo '<group>';
-    echo '<groupname>'.htmlentities($group->GetName()).'</groupname>';
-    echo '<legendlabel>'.htmlentities($group->GetLegendLabel()).'</legendlabel>';
+    echo '<groupname>'.htmlspecialchars($group->GetName()).'</groupname>';
+    echo '<legendlabel>'.htmlspecialchars($group->GetLegendLabel()).'</legendlabel>';
     echo '<uniqueid>'.$group->GetObjectId().'</uniqueid>';
     echo '<displayinlegend>'.BooleanToString($group->GetDisplayInLegend()).'</displayinlegend>';
     echo '<expandinlegend>'.BooleanToString($group->GetExpandInLegend()).'</expandinlegend>';
@@ -168,8 +168,8 @@
                     $labelText = $label->length==1? $label->item(0)->nodeValue: "";
                     $filterText = $filter->length==1? $filter->item(0)->nodeValue: "";
                     $output .= '<styleitem>';
-                    $output .= '<label>'.htmlentities(trim($labelText)).'</label>';
-                    $output .= '<filter>'.htmlentities(trim($filterText)).'</filter>';
+                    $output .= '<label>'.htmlspecialchars(trim($labelText)).'</label>';
+                    $output .= '<filter>'.htmlspecialchars(trim($filterText)).'</filter>';
                     $output .= '<geomtype>'.($ts+1).'</geomtype>';
                     $output .= '<categoryindex>'.($catIndex++).'</categoryindex>';
                     $output .= '</styleitem>';

Modified: trunk/layers/MapGuide/php/Legend.php
===================================================================
--- trunk/layers/MapGuide/php/Legend.php	2011-01-24 08:55:25 UTC (rev 2326)
+++ trunk/layers/MapGuide/php/Legend.php	2011-01-24 09:54:18 UTC (rev 2327)
@@ -68,7 +68,7 @@
 
     echo '<layer>';
     echo '<uniqueid>'.$layer->GetObjectId().'</uniqueid>';
-    echo '<layername>'.htmlentities($layer->GetName()).'</layername>';
+    echo '<layername>'.htmlspecialchars($layer->GetName()).'</layername>';
     echo '<layertype>'.$layer->GetLayerType().'</layertype>';
     echo '<displayinlegend>'.BooleanToString($layer->GetDisplayInLegend()).'</displayinlegend>';
     echo '<expandinlegend>'.BooleanToString($layer->GetExpandInLegend()).'</expandinlegend>';
@@ -76,7 +76,7 @@
     if ($layer->GetGroup()) {
         echo '<parentgroup>'.$layer->GetGroup()->GetObjectId().'</parentgroup>';
     }
-    echo '<legendlabel>'.htmlentities($layer->GetLegendLabel()).'</legendlabel>';
+    echo '<legendlabel>'.htmlspecialchars($layer->GetLegendLabel()).'</legendlabel>';
     echo '<selectable>'.BooleanToString($layer->GetSelectable()).'</selectable>';
     echo '<visible>'.BooleanToString($layer->GetVisible()).'</visible>';
     echo '<actuallyvisible>'.BooleanToString($layer->isVisible()).'</actuallyvisible>';
@@ -93,8 +93,8 @@
     $group=$groups->GetItem($i);
     $layerDefinition = $layer->GetLayerDefinition();
     echo '<group>';
-    echo '<groupname>'.htmlentities($group->GetName()).'</groupname>';
-    echo '<legendlabel>'.htmlentities($group->GetLegendLabel()).'</legendlabel>';
+    echo '<groupname>'.htmlspecialchars($group->GetName()).'</groupname>';
+    echo '<legendlabel>'.htmlspecialchars($group->GetLegendLabel()).'</legendlabel>';
     echo '<uniqueid>'.$group->GetObjectId().'</uniqueid>';
     echo '<displayinlegend>'.BooleanToString($group->GetDisplayInLegend()).'</displayinlegend>';
     echo '<expandinlegend>'.BooleanToString($group->GetExpandInLegend()).'</expandinlegend>';
@@ -168,8 +168,8 @@
                     $labelText = $label->length==1? $label->item(0)->nodeValue: "";
                     $filterText = $filter->length==1? $filter->item(0)->nodeValue: "";
                     $output .= '<styleitem>';
-                    $output .= '<label>'.htmlentities(trim($labelText)).'</label>';
-                    $output .= '<filter>'.htmlentities(trim($filterText)).'</filter>';
+                    $output .= '<label>'.htmlspecialchars(trim($labelText)).'</label>';
+                    $output .= '<filter>'.htmlspecialchars(trim($filterText)).'</filter>';
                     $output .= '<geomtype>'.($ts+1).'</geomtype>';
                     $output .= '<categoryindex>'.($catIndex++).'</categoryindex>';
                     $output .= '</styleitem>';



More information about the fusion-commits mailing list