Changed references to /tmp to sys_get_temp_dir
This commit is contained in:
parent
c1068f1b2b
commit
fc3c6625bd
@ -271,7 +271,7 @@ class DanbooruApi extends Extension
|
|||||||
}
|
}
|
||||||
} elseif (isset($_REQUEST['source']) || isset($_REQUEST['post']['source'])) { // A url was provided
|
} elseif (isset($_REQUEST['source']) || isset($_REQUEST['post']['source'])) { // A url was provided
|
||||||
$source = isset($_REQUEST['source']) ? $_REQUEST['source'] : $_REQUEST['post']['source'];
|
$source = isset($_REQUEST['source']) ? $_REQUEST['source'] : $_REQUEST['post']['source'];
|
||||||
$file = tempnam("/tmp", "shimmie_transload");
|
$file = tempnam(sys_get_temp_dir(), "shimmie_transload");
|
||||||
$ok = transload($source, $file);
|
$ok = transload($source, $file);
|
||||||
if (!$ok) {
|
if (!$ok) {
|
||||||
$page->set_code(409);
|
$page->set_code(409);
|
||||||
|
@ -364,7 +364,7 @@ class Media extends Extension
|
|||||||
}
|
}
|
||||||
|
|
||||||
$inname = warehouse_path(Image::IMAGE_DIR, $hash);
|
$inname = warehouse_path(Image::IMAGE_DIR, $hash);
|
||||||
$tmpname = tempnam("/tmp", "shimmie_ffmpeg_thumb");
|
$tmpname = tempnam(sys_get_temp_dir(), "shimmie_ffmpeg_thumb");
|
||||||
$outname = warehouse_path(Image::THUMBNAIL_DIR, $hash);
|
$outname = warehouse_path(Image::THUMBNAIL_DIR, $hash);
|
||||||
|
|
||||||
$orig_size = self::video_size($inname);
|
$orig_size = self::video_size($inname);
|
||||||
|
@ -475,7 +475,7 @@ class OuroborosAPI extends Extension
|
|||||||
) !== false
|
) !== false
|
||||||
) {
|
) {
|
||||||
// Transload from source
|
// Transload from source
|
||||||
$meta['file'] = tempnam('/tmp', 'shimmie_transload_' . $config->get_string('transload_engine'));
|
$meta['file'] = tempnam(sys_get_temp_dir(), 'shimmie_transload_' . $config->get_string(UploadConfig::TRANSLOAD_ENGINE));
|
||||||
$meta['filename'] = basename($post->file_url);
|
$meta['filename'] = basename($post->file_url);
|
||||||
if (!transload($post->file_url, $meta['file'])) {
|
if (!transload($post->file_url, $meta['file'])) {
|
||||||
$this->sendResponse(500, 'Transloading failed');
|
$this->sendResponse(500, 'Transloading failed');
|
||||||
|
@ -198,7 +198,7 @@ class ResizeImage extends Extension
|
|||||||
list($new_height, $new_width) = $this->calc_new_size($image_obj, $width, $height);
|
list($new_height, $new_width) = $this->calc_new_size($image_obj, $width, $height);
|
||||||
|
|
||||||
/* Temp storage while we resize */
|
/* Temp storage while we resize */
|
||||||
$tmp_filename = tempnam("/tmp", 'shimmie_resize');
|
$tmp_filename = tempnam(sys_get_temp_dir(), 'shimmie_resize');
|
||||||
if (empty($tmp_filename)) {
|
if (empty($tmp_filename)) {
|
||||||
throw new ImageResizeException("Unable to save temporary image file.");
|
throw new ImageResizeException("Unable to save temporary image file.");
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,7 @@ class TranscodeImage extends Extension
|
|||||||
|
|
||||||
$q = $config->get_int("transcode_quality");
|
$q = $config->get_int("transcode_quality");
|
||||||
|
|
||||||
$tmp_name = tempnam("/tmp", "shimmie_transcode");
|
$tmp_name = tempnam(sys_get_temp_dir(), "shimmie_transcode");
|
||||||
|
|
||||||
$image = imagecreatefromstring(file_get_contents($source_name));
|
$image = imagecreatefromstring(file_get_contents($source_name));
|
||||||
try {
|
try {
|
||||||
@ -383,7 +383,8 @@ class TranscodeImage extends Extension
|
|||||||
$bg = "black";
|
$bg = "black";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$tmp_name = tempnam("/tmp", "shimmie_transcode");
|
|
||||||
|
$tmp_name = tempnam(sys_get_temp_dir(), "shimmie_transcode");
|
||||||
|
|
||||||
$source_type = "";
|
$source_type = "";
|
||||||
switch ($source_format) {
|
switch ($source_format) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user