Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions viewimage.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,28 @@

loggedinorreturn();

$pic = htmlspecialchars_uni((string) $_GET["pic"]);
$pic = html_uni($_GET["pic"]);

stdhead("�������� ��������");
print("<h1>$pic</h1>\n");
print("<p align=center><img src=\"torrents/images/$pic\"></p>\n");
?>
if(empty($pic))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему убрал линк?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Какой линк?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На страницу назад.

stderr("Внимание, обнаружена ошибка", "По данному адресу публикаций на сайте не найдено, либо у вас нет доступа для просмотра информации по данному адресу.");

<h3 align=center><a href="javascript: history.go(-1)">�����</a></h3>
$allowed_image_types = array("image/gif" => "gif", "image/png" => "png", "image/jpeg" => "jpeg", "image/jpg" => "jpg");

<?
$file_extension = pathinfo($pic, PATHINFO_EXTENSION);

if (!in_array($file_extension, $allowed_image_types))
stderr("Внимание, обнаружена ошибка", "По данному адресу публикаций на сайте не найдено, либо у вас нет доступа для просмотра информации по данному адресу.");


stdhead("Просмотр картинки");



print("<h1>".$pic."</h1>\n");


print("<p align=center><img width=\"100%\" src=\"".(file_exists("torrents/images/".$pic) ? "torrents/images/".$pic : $pic_base_url."/default_torrent.png")."
\"></p>\n");
echo "<h3 align=center><a href=\"javascript: history.go(-1)\">Назад</a></h3>";
stdfoot();
?>
?>