[fusion-commits] r2490 - sandbox/adsk/2.4jbeta2/widgets/QuickPlot
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Tue Dec 20 02:20:07 EST 2011
Author: liuar
Date: 2011-12-19 23:20:07 -0800 (Mon, 19 Dec 2011)
New Revision: 2490
Modified:
sandbox/adsk/2.4jbeta2/widgets/QuickPlot/GeneratePicture.php
Log:
Fix Defect: 1415610 - BETA2:[Legacy]Quick Plot doesn't work for both Windows and Linux Server.
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/widgets/QuickPlot/GeneratePicture.php
===================================================================
--- sandbox/adsk/2.4jbeta2/widgets/QuickPlot/GeneratePicture.php 2011-12-20 07:01:32 UTC (rev 2489)
+++ sandbox/adsk/2.4jbeta2/widgets/QuickPlot/GeneratePicture.php 2011-12-20 07:20:07 UTC (rev 2490)
@@ -122,7 +122,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 fusion-commits
mailing list