forked from Cavemanon/cavepaintings
simplify and add tests for upload (and replace) path
This commit is contained in:
@@ -290,7 +290,7 @@ class DanbooruApi extends Extension
|
||||
} elseif (isset($_REQUEST['source']) || isset($_REQUEST['post']['source'])) { // A url was provided
|
||||
$source = isset($_REQUEST['source']) ? $_REQUEST['source'] : $_REQUEST['post']['source'];
|
||||
$file = tempnam(sys_get_temp_dir(), "shimmie_transload");
|
||||
$ok = transload($source, $file);
|
||||
$ok = fetch_url($source, $file);
|
||||
if (!$ok) {
|
||||
$page->set_code(409);
|
||||
$page->add_http_header("X-Danbooru-Errors: fopen read error");
|
||||
|
Reference in New Issue
Block a user