diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2023-01-30 17:27:57 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2023-01-30 17:27:57 +0100 |
commit | c6156989725399a83f4a33384a3c60885ed6f211 (patch) | |
tree | 842d3fb0e54e1f5c8ccaf1941dc8caf8a8863c6a /www/list.php | |
parent | fix use after free in torrent structs (diff) | |
download | travnik-c6156989725399a83f4a33384a3c60885ed6f211.tar travnik-c6156989725399a83f4a33384a3c60885ed6f211.tar.gz travnik-c6156989725399a83f4a33384a3c60885ed6f211.tar.bz2 travnik-c6156989725399a83f4a33384a3c60885ed6f211.tar.lz travnik-c6156989725399a83f4a33384a3c60885ed6f211.tar.xz travnik-c6156989725399a83f4a33384a3c60885ed6f211.tar.zst travnik-c6156989725399a83f4a33384a3c60885ed6f211.zip |
Diffstat (limited to 'www/list.php')
-rw-r--r-- | www/list.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/www/list.php b/www/list.php new file mode 100644 index 0000000..6dbeb40 --- /dev/null +++ b/www/list.php @@ -0,0 +1,17 @@ +<?php +require_once "vendor/autoload.php"; +use Rhilip\Bencode\TorrentFile; +use Rhilip\Bencode\ParseException; +if ($handle = opendir("..")) { + echo "<ul>"; + while (false !== ($entry = readdir($handle))) { + if (preg_match("/torrent$/", $entry)) { + $h = htmlspecialchars(explode(".", $entry)[0]); + echo '<li> <a href="info.php?h=' . $h . '">' . $h . '</a>'; + } + } + die(); + closedir($handle); +} else { + die("ne morem brati direktorija"); +} |