use sys_get_temp_dir() to address open_basedir restictions to /tmp master
use sys_get_temp_dir() to address open_basedir restictions to /tmp

file:a/readme.txt -> file:b/readme.txt
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@
 Tags: varnish, purge, cache, caching, optimization, performance, traffic
 Requires at least: 4.0
 Tested up to: 4.9
-Stable tag: 1.6.6
+Stable tag: 1.6.7
 License: GPLv2 or later
 
 Wordpress Varnish Cache 3.x/4.x/5.x integration
@@ -116,6 +116,9 @@
 
 == Changelog ==
 
+= 1.6.7 =
+* use sys_get_temp_dir() to address open_basedir restictions to /tmp. thanks @maltfield
+
 = 1.6.6 =
 * no more SSl auto detection. If you use SSL with Varnish use the option 'Use SSL (https://) for purge requests.'
 * there are cases where the website uses SSL, but the Varnish servers do not

--- a/vcaching.php
+++ b/vcaching.php
@@ -3,7 +3,7 @@
 Plugin Name: Varnish Caching
 Plugin URI: http://wordpress.org/extend/plugins/vcaching/
 Description: WordPress Varnish Cache integration.
-Version: 1.6.6
+Version: 1.6.7
 Author: Razvan Stanga
 Author URI: http://git.razvi.ro/
 License: http://www.apache.org/licenses/LICENSE-2.0
@@ -912,7 +912,7 @@
 
         if(isset($_POST['option_page']) && $_POST['option_page'] == $this->prefix . 'download') {
             $version = in_array($_POST['varnish_caching_varnish_version'], array(3,4,5)) ? $_POST['varnish_caching_varnish_version'] : 3;
-            $tmpfile = tempnam("tmp", "zip");
+            $tmpfile = tempnam(sys_get_temp_dir(), "zip");
             $zip = new ZipArchive();
             $zip->open($tmpfile, ZipArchive::OVERWRITE);
             $files = array(

comments