[mapguide-commits] r6344 -
sandbox/adsk/2.4jbeta2/Web/src/mapviewerphp
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Dec 20 02:19:17 EST 2011
Author: liuar
Date: 2011-12-19 23:19:17 -0800 (Mon, 19 Dec 2011)
New Revision: 6344
Modified:
sandbox/adsk/2.4jbeta2/Web/src/mapviewerphp/quickplotgeneratepicture.php
Log:
Fix Defect: 1415610 - BETA2:[Legacy]Quick Plot doesn't work for both Windows and Linux Server.
Review #16206
This defect is caused by below code:
$tempImage = sys_get_temp_dir() . uniqid();
The return value of sys_get_temp_dir() will not end with a path separator. As a result, On windows, it tries to create a temp file like c:\Windows\temp1234.tmp, on Linux it tries to create a temp file like: /tmp1234.tmp. Then the permission is denied.
Then use tempnam() to handle the path separator.
Modified: sandbox/adsk/2.4jbeta2/Web/src/mapviewerphp/quickplotgeneratepicture.php
===================================================================
--- sandbox/adsk/2.4jbeta2/Web/src/mapviewerphp/quickplotgeneratepicture.php 2011-12-19 02:39:48 UTC (rev 6343)
+++ sandbox/adsk/2.4jbeta2/Web/src/mapviewerphp/quickplotgeneratepicture.php 2011-12-20 07:19:17 UTC (rev 6344)
@@ -116,7 +116,7 @@
"PNG",
false);
- $tempImage = sys_get_temp_dir() . uniqid();
+ $tempImage = tempnam(sys_get_temp_dir(), "mgo");
$mgReader->ToFile($tempImage);
$image = imagecreatefrompng($tempImage);
unlink($tempImage);
More information about the mapguide-commits
mailing list