[fusion-commits] r1345 - trunk/MapServer/php

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Mar 27 14:12:52 EDT 2008


Author: wbronsema
Date: 2008-03-27 14:12:51 -0400 (Thu, 27 Mar 2008)
New Revision: 1345

Modified:
   trunk/MapServer/php/LegendIcon.php
Log:
fixes #43 - added check for closing forward slash on legendIconCacheDir variable.

Modified: trunk/MapServer/php/LegendIcon.php
===================================================================
--- trunk/MapServer/php/LegendIcon.php	2008-03-27 15:58:43 UTC (rev 1344)
+++ trunk/MapServer/php/LegendIcon.php	2008-03-27 18:12:51 UTC (rev 1345)
@@ -25,7 +25,7 @@
  */
 
 /*****************************************************************************
- * Purpose: Draw a legend icon 
+ * Purpose: Draw a legend icon
  *****************************************************************************/
 
 include(dirname(__FILE__).'/Common.php');
@@ -57,6 +57,14 @@
             /* if the legendIconCache dir is set */
             if (isset($configObj->mapserver->legendIconCacheDir)) {
               $legendIconCacheDir = $configObj->mapserver->legendIconCacheDir;
+
+              // check for closing '/'
+              $legendIconCacheDir = str_replace( '\\', '/', trim( $legendIconCacheDir ) );
+              if ( substr( $legendIconCacheDir, -1 ) != '/' )
+              {
+                  $legendIconCacheDir .= '/';
+              }
+
               $cacheLegendIcons = true;
               $str = file_get_contents($_SESSION['maps'][$mapName]);
               /* create a unique location for the map icons based on
@@ -89,7 +97,7 @@
       $width = 16;
     if ($height <=0)
       $height = 16;
-    
+
     $oImg = $oClass->createLegendIcon($width, $height);
     /* TODO: can we figure out what the content type is? */
     header('Content-type: image/png');



More information about the fusion-commits mailing list