Unqualified function/constant reference and much more

Signed-off-by: Yuriy Pikhtarev <iglix@me.com>
This commit is contained in:
Yuriy Pikhtarev 2018-06-24 16:35:13 +03:00
commit 78af495048
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
68 changed files with 273 additions and 277 deletions

47
dl.php
View file

@ -128,7 +128,6 @@ for ($i = 0; $i < $num_auth_pages && $authorised == false; $i++) {
$topic_id = $row['topic_id'];
$forum_id = $row['forum_id'];
$is_auth = array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata);
set_die_append_msg($forum_id, $topic_id);
@ -181,27 +180,27 @@ if ($download_mode == PHYSICAL_LINK) {
$url = make_url($upload_dir . '/' . $attachment['physical_filename']);
header('Location: ' . $url);
exit;
} else {
if (IS_GUEST && !bb_captcha('check')) {
global $template;
$redirect_url = $_POST['redirect_url'] ?? isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/';
$message = '<form action="' . DOWNLOAD_URL . $attachment['attach_id'] . '" method="post">';
$message .= $lang['CAPTCHA'] . ':';
$message .= '<div class="mrg_10" align="center">' . bb_captcha('get') . '</div>';
$message .= '<input type="hidden" name="redirect_url" value="' . $redirect_url . '" />';
$message .= '<input type="submit" class="bold" value="' . $lang['SUBMIT'] . '" /> &nbsp;';
$message .= '<input type="button" class="bold" value="' . $lang['GO_BACK'] . '" onclick="document.location.href = \'' . $redirect_url . '\';" />';
$message .= '</form>';
$template->assign_vars(array(
'ERROR_MESSAGE' => $message,
));
require(PAGE_HEADER);
require(PAGE_FOOTER);
}
send_file_to_browser($attachment, $upload_dir);
exit;
}
if (IS_GUEST && !bb_captcha('check')) {
global $template;
$redirect_url = $_POST['redirect_url'] ?? $_SERVER['HTTP_REFERER'] ?? '/';
$message = '<form action="' . DOWNLOAD_URL . $attachment['attach_id'] . '" method="post">';
$message .= $lang['CAPTCHA'] . ':';
$message .= '<div class="mrg_10" align="center">' . bb_captcha('get') . '</div>';
$message .= '<input type="hidden" name="redirect_url" value="' . $redirect_url . '" />';
$message .= '<input type="submit" class="bold" value="' . $lang['SUBMIT'] . '" /> &nbsp;';
$message .= '<input type="button" class="bold" value="' . $lang['GO_BACK'] . '" onclick="document.location.href = \'' . $redirect_url . '\';" />';
$message .= '</form>';
$template->assign_vars(array(
'ERROR_MESSAGE' => $message,
));
require(PAGE_HEADER);
require(PAGE_FOOTER);
}
send_file_to_browser($attachment, $upload_dir);
exit;