From b632c92d25f8769976dadd969c70308e98190aeb Mon Sep 17 00:00:00 2001 From: shish Date: Wed, 2 Jan 2008 23:12:39 +0000 Subject: [PATCH] wget option for transloading git-svn-id: file:///home/shish/svn/shimmie2/trunk@682 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/upload/main.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/upload/main.php b/ext/upload/main.php index 6435ddef..8043d1b6 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -56,7 +56,8 @@ class Upload extends Extension { $sb->add_choice_option("transload_engine", array( "Disabled" => "none", "cURL" => "curl", - "fopen" => "fopen" + "fopen" => "fopen", + "WGet" => "wget" ), "
Transload: "); $event->panel->add_block($sb); } @@ -150,6 +151,13 @@ class Upload extends Extension { fclose($fp); } + if($config->get_string("transload_engine") == "wget") { + $ua = "Shimmie-".VERSION; + $s_url = escapeshellarg($url); + $s_tmp = escapeshellarg($tmp_filename); + system("wget $s_url --output-document=$s_tmp --user-agent=$ua --referer=$s_url"); + } + if(filesize($tmp_filename) == 0) { $this->theme->display_upload_error($page, "Error with ".html_escape($filename), "No data found -- perhaps the site has hotlink protection?");