Skip to content

Commit

Permalink
minor (security) edit
Browse files Browse the repository at this point in the history
  • Loading branch information
drkameleon committed Nov 14, 2023
1 parent fb1d9a5 commit 71d55dc
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions website/download.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
$mgk = $_GET["mgk"];

if (($pkg != "") && ($ver != "") && ($mgk == "18966")) {
$filename = "/var/www/pkg_stats/" . $pkg . "-" . $ver . ".cnt";
$cnt = 0;
if (file_exists($filename)){
$cnt = intval(file_get_contents($filename));
}
else {
touch($filename);
chmod($filename, 0777);
}
$cnt = $cnt + 1;
if ((is_dir("/var/www/pkgr.art/public/" . $pkg)) &&
(is_dir("/var/www/pkgr.art/public/" . $pkg . "/" . $ver))) {
$filename = "/var/www/pkg_stats/" . $pkg . "-" . $ver . ".cnt";
$cnt = 0;
if (file_exists($filename)){
$cnt = intval(file_get_contents($filename));
}
else {
touch($filename);
chmod($filename, 0777);
}
$cnt = $cnt + 1;

$openFile = fopen($filename, "w+") or die("Can't open file");
fwrite($openFile, strval($cnt));
fclose($openFile);
fclose($myfile);
$openFile = fopen($filename, "w+") or die("Can't open file");
fwrite($openFile, strval($cnt));
fclose($openFile);

echo $cnt;
echo $cnt;
}
}

?>

0 comments on commit 71d55dc

Please sign in to comment.