$email)); } else { $download_url_suffix_params["ref"] = $ref; $redirect_url = "pages/download_progress.php"; } $download_url_suffix_params = array_merge( $download_url_suffix_params, [ "size" => $size, "ext" => $ext, "k" => $k, "alternative" => $alternative, "iaccept" => $iaccept, "usage" => $usage, "usagecomment" => $usagecomment, "offset" => getval("saved_offset", getval("offset", 0, true)), "order_by" => getval("saved_order_by", getval("order_by", '')), "sort" => getval("saved_sort", getval("sort", '')), "archive" => getval("saved_archive", getval("archive", '')), "email" => $email ] ); $url_parts = []; if (strpos($url, '?') !== false) { parse_str(explode('?', $url)[1], $url_parts); } if (strpos($url, 'download.php') !== false && count($url_parts) > 0 && isset($url_parts['noattach']) && $url_parts['noattach'] == true) { $redirect_url = $url; } elseif (strpos($url, 'download.php') !== false && (strpos($url, $baseurl_short) !== false || strpos($url, $baseurl) !== false)) { $download_url_suffix_params['url'] = $url; } redirect(generateURL($redirect_url, $download_url_suffix_params, $url_parts)); } } include "../include/header.php"; if (isset($download_usage_prevent_options)) { ?>

" />
{error}
'; $replace = array( "{label}" => $lang["usagecomments"], "{error}" => isset($error["usagecomment"]) ? $error["usagecomment"] : "", "{value}" => escape($usagecomment) ); $html = str_replace(array_keys($replace), array_values($replace), $html); return $html; } /** * Validate download usage form field values. Uses config var $usage_comment_blank to determine whether to validate usagecomment * * @param array $fields - list of fields to validate * * @return array $error - list of fields with error messages */ function validate_input_download_usage($fields) { global $lang, $usage_comment_blank, $download_usage_email, $remove_usage_textbox; $error = array(); $error["usage"] = $fields["usage"] == "" ? $lang["usageincorrect"] : ""; if (!$remove_usage_textbox) { $error["usagecomment"] = $fields["usagecomment"] == "" && !$usage_comment_blank ? $lang["usageincorrect"] : ""; } if ($download_usage_email) { $error["email"] = !filter_var($fields["email"], FILTER_VALIDATE_EMAIL) ? $lang["error_invalid_email"] : ""; } $error = array_filter($error); return $error; } ?>