From ca0fcebc15beb3d5d789ca9e21ed007a613a42f9 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 23 Jun 2014 22:35:00 +0200 Subject: [PATCH] The tempory path is now fetched from a new function (that ensures that the value is set correctly) --- appnet/appnet.php | 2 +- privacy_image_cache/privacy_image_cache.php | 2 +- statusnet/codebird.php | 2 +- statusnet/statusnet.php | 4 ++-- twitter/twitter.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/appnet/appnet.php b/appnet/appnet.php index e375c8d3..52f75437 100644 --- a/appnet/appnet.php +++ b/appnet/appnet.php @@ -475,7 +475,7 @@ function appnet_send(&$a,&$b) { if (isset($post["image"])) { $img_str = fetch_url($post['image'],true, $redirects, 10); - $tempfile = tempnam(get_config("system","temppath"), "cache"); + $tempfile = tempnam(get_temppath(), "cache"); file_put_contents($tempfile, $img_str); try { diff --git a/privacy_image_cache/privacy_image_cache.php b/privacy_image_cache/privacy_image_cache.php index a0cd8107..0a6d8be1 100644 --- a/privacy_image_cache/privacy_image_cache.php +++ b/privacy_image_cache/privacy_image_cache.php @@ -156,7 +156,7 @@ function privacy_image_cache_init() { $redirects = 0; $img_str = fetch_url($_REQUEST['url'],true, $redirects, 10); - $tempfile = tempnam(get_config("system","temppath"), "cache"); + $tempfile = tempnam(get_temppath(), "cache"); file_put_contents($tempfile, $img_str); $mime = image_type_to_mime_type(exif_imagetype($tempfile)); unlink($tempfile); diff --git a/statusnet/codebird.php b/statusnet/codebird.php index 14d231d7..cba5f936 100644 --- a/statusnet/codebird.php +++ b/statusnet/codebird.php @@ -820,7 +820,7 @@ class CodebirdSN } // To-Do - $tempfile = tempnam(get_config("system","temppath"), "mimecheck"); + $tempfile = tempnam(get_temppath(), "mimecheck"); file_put_contents($tempfile, $data); $mime = image_type_to_mime_type(exif_imagetype($tempfile)); unlink($tempfile); diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index b619a042..7293f882 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -570,7 +570,7 @@ function statusnet_post_hook(&$a,&$b) { if ($image != "") { $img_str = fetch_url($image); - $tempfile = tempnam(get_config("system","temppath"), "cache"); + $tempfile = tempnam(get_temppath(), "cache"); file_put_contents($tempfile, $img_str); $postdata = array("status" => $msg, "media[]" => $tempfile); } else @@ -1446,7 +1446,7 @@ function statusnet_convertmsg($a, $body, $no_tags = false) { else { $img_str = fetch_url($expanded_url, true, $redirects, 4); - $tempfile = tempnam(get_config("system","temppath"), "cache"); + $tempfile = tempnam(get_temppath(), "cache"); file_put_contents($tempfile, $img_str); $mime = image_type_to_mime_type(exif_imagetype($tempfile)); unlink($tempfile); diff --git a/twitter/twitter.php b/twitter/twitter.php index 6e98888b..b6d0d3af 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -479,7 +479,7 @@ function twitter_post_hook(&$a,&$b) { if(strlen($msg) and ($image != "")) { $img_str = fetch_url($image); - $tempfile = tempnam(get_config("system","temppath"), "cache"); + $tempfile = tempnam(get_temppath(), "cache"); file_put_contents($tempfile, $img_str); // Twitter had changed something so that the old library doesn't work anymore @@ -1075,7 +1075,7 @@ function twitter_expand_entities($a, $body, $item, $no_tags = false, $picture) { else { $img_str = fetch_url($expanded_url, true, $redirects, 4); - $tempfile = tempnam(get_config("system","temppath"), "cache"); + $tempfile = tempnam(get_temppath(), "cache"); file_put_contents($tempfile, $img_str); $mime = image_type_to_mime_type(exif_imagetype($tempfile)); unlink($tempfile);