The tempory path is now fetched from a new function (that ensures that the value is set correctly)
parent
8220fca1e1
commit
ca0fcebc15
|
@ -475,7 +475,7 @@ function appnet_send(&$a,&$b) {
|
||||||
|
|
||||||
if (isset($post["image"])) {
|
if (isset($post["image"])) {
|
||||||
$img_str = fetch_url($post['image'],true, $redirects, 10);
|
$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);
|
file_put_contents($tempfile, $img_str);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -156,7 +156,7 @@ function privacy_image_cache_init() {
|
||||||
$redirects = 0;
|
$redirects = 0;
|
||||||
$img_str = fetch_url($_REQUEST['url'],true, $redirects, 10);
|
$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);
|
file_put_contents($tempfile, $img_str);
|
||||||
$mime = image_type_to_mime_type(exif_imagetype($tempfile));
|
$mime = image_type_to_mime_type(exif_imagetype($tempfile));
|
||||||
unlink($tempfile);
|
unlink($tempfile);
|
||||||
|
|
|
@ -820,7 +820,7 @@ class CodebirdSN
|
||||||
}
|
}
|
||||||
|
|
||||||
// To-Do
|
// To-Do
|
||||||
$tempfile = tempnam(get_config("system","temppath"), "mimecheck");
|
$tempfile = tempnam(get_temppath(), "mimecheck");
|
||||||
file_put_contents($tempfile, $data);
|
file_put_contents($tempfile, $data);
|
||||||
$mime = image_type_to_mime_type(exif_imagetype($tempfile));
|
$mime = image_type_to_mime_type(exif_imagetype($tempfile));
|
||||||
unlink($tempfile);
|
unlink($tempfile);
|
||||||
|
|
|
@ -570,7 +570,7 @@ function statusnet_post_hook(&$a,&$b) {
|
||||||
|
|
||||||
if ($image != "") {
|
if ($image != "") {
|
||||||
$img_str = fetch_url($image);
|
$img_str = fetch_url($image);
|
||||||
$tempfile = tempnam(get_config("system","temppath"), "cache");
|
$tempfile = tempnam(get_temppath(), "cache");
|
||||||
file_put_contents($tempfile, $img_str);
|
file_put_contents($tempfile, $img_str);
|
||||||
$postdata = array("status" => $msg, "media[]" => $tempfile);
|
$postdata = array("status" => $msg, "media[]" => $tempfile);
|
||||||
} else
|
} else
|
||||||
|
@ -1446,7 +1446,7 @@ function statusnet_convertmsg($a, $body, $no_tags = false) {
|
||||||
else {
|
else {
|
||||||
$img_str = fetch_url($expanded_url, true, $redirects, 4);
|
$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);
|
file_put_contents($tempfile, $img_str);
|
||||||
$mime = image_type_to_mime_type(exif_imagetype($tempfile));
|
$mime = image_type_to_mime_type(exif_imagetype($tempfile));
|
||||||
unlink($tempfile);
|
unlink($tempfile);
|
||||||
|
|
|
@ -479,7 +479,7 @@ function twitter_post_hook(&$a,&$b) {
|
||||||
if(strlen($msg) and ($image != "")) {
|
if(strlen($msg) and ($image != "")) {
|
||||||
$img_str = fetch_url($image);
|
$img_str = fetch_url($image);
|
||||||
|
|
||||||
$tempfile = tempnam(get_config("system","temppath"), "cache");
|
$tempfile = tempnam(get_temppath(), "cache");
|
||||||
file_put_contents($tempfile, $img_str);
|
file_put_contents($tempfile, $img_str);
|
||||||
|
|
||||||
// Twitter had changed something so that the old library doesn't work anymore
|
// 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 {
|
else {
|
||||||
$img_str = fetch_url($expanded_url, true, $redirects, 4);
|
$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);
|
file_put_contents($tempfile, $img_str);
|
||||||
$mime = image_type_to_mime_type(exif_imagetype($tempfile));
|
$mime = image_type_to_mime_type(exif_imagetype($tempfile));
|
||||||
unlink($tempfile);
|
unlink($tempfile);
|
||||||
|
|
Loading…
Reference in New Issue