|
|
@ -523,8 +523,14 @@ if (isset($_POST['delete'])) { |
|
|
|
$_POST['subject'] = ''; |
|
|
|
} |
|
|
|
|
|
|
|
if ($config['allow_upload_by_url'] && isset($_POST['file_url']) && !empty($_POST['file_url'])) { |
|
|
|
$post['file_url'] = $_POST['file_url']; |
|
|
|
if ($config['allow_upload_by_url'] && isset($_POST['file_url1']) && !empty($_POST['file_url1'])) { |
|
|
|
function unlink_tmp_file($file) { |
|
|
|
@unlink($file); |
|
|
|
fatal_error_handler(); |
|
|
|
} |
|
|
|
|
|
|
|
function upload_by_url($config,$post,$url) { |
|
|
|
$post['file_url'] = $url; |
|
|
|
if (!preg_match('@^https?://@', $post['file_url'])) |
|
|
|
error($config['error']['invalidimg']); |
|
|
|
|
|
|
@ -543,10 +549,6 @@ if (isset($_POST['delete'])) { |
|
|
|
error($config['error']['unknownext']); |
|
|
|
|
|
|
|
$post['file_tmp'] = tempnam($config['tmp'], 'url'); |
|
|
|
function unlink_tmp_file($file) { |
|
|
|
@unlink($file); |
|
|
|
fatal_error_handler(); |
|
|
|
} |
|
|
|
register_shutdown_function('unlink_tmp_file', $post['file_tmp']); |
|
|
|
|
|
|
|
$fp = fopen($post['file_tmp'], 'w'); |
|
|
@ -569,13 +571,20 @@ if (isset($_POST['delete'])) { |
|
|
|
|
|
|
|
fclose($fp); |
|
|
|
|
|
|
|
$_FILES['file'] = array( |
|
|
|
$_FILES[$post['file_tmp']] = array( |
|
|
|
'name' => basename($url_without_params), |
|
|
|
'tmp_name' => $post['file_tmp'], |
|
|
|
'file_tmp' => true, |
|
|
|
'error' => 0, |
|
|
|
'size' => filesize($post['file_tmp']) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
for( $counter = 1; $counter <= $config['max_images']; $counter++ ) { |
|
|
|
$varname = "file_url". $counter; |
|
|
|
upload_by_url($config,$post,$_POST[$varname]); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$post['name'] = $_POST['name'] != '' ? $_POST['name'] : $config['anonymous']; |
|
|
@ -991,8 +1000,7 @@ if (isset($_POST['delete'])) { |
|
|
|
escapeshellarg($file['thumb'])); |
|
|
|
|
|
|
|
if ($error){ |
|
|
|
$path = sprintf($config['file_thumb'],isset($config['file_icons'][$file['extension']]) ? $config['file_icons'][$file['ext |
|
|
|
ension']] : $config['file_icons']['default']); |
|
|
|
$path = sprintf($config['file_thumb'],isset($config['file_icons'][$file['extension']]) ? $config['file_icons'][$file['extension']] : $config['file_icons']['default']); |
|
|
|
} |
|
|
|
|
|
|
|
$file['thumb'] = basename($file['thumb']); |
|
|
|