Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from noten-app/#16-Fix-Parameter-Security-Disi…
Browse files Browse the repository at this point in the history
…mprovements

🐛 💩 Fix Parameter Security Disimprovements #16
  • Loading branch information
CuzImBisonratte authored Sep 22, 2023
2 parents 5697a9c + 7cefa9a commit ac54130
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
7 changes: 0 additions & 7 deletions classes/add/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<?php

// Check if class url-parameter is given
if (!isset($_GET["class"])) header("Location: /classes");
$class_id = htmlspecialchars($_GET["class"]);
// Check if class is a-z or 0-9
if (!preg_match("/^[a-z0-9]*$/", $class_id)) header("Location: /classes");

// Check login state
require("../../res/php/session.php");
start_session();
Expand Down Expand Up @@ -138,7 +132,6 @@
<div class="class_add">
<div>Create class <i class="fas fa-plus"></i></div>
</div>
<div id="class_id" style="display: none;"><?= $class_id ?></div>
</main>
<script src="https://assets.noten-app.de/js/jquery/jquery-3.6.1.min.js"></script>
<script src="https://assets.noten-app.de/js/themes/themes.js"></script>
Expand Down
7 changes: 0 additions & 7 deletions homework/add/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<?php

// Check if class url-parameter is given
if (!isset($_GET["class"])) header("Location: /classes");
$class_id = htmlspecialchars($_GET["class"]);
// Check if class is a-z or 0-9
if (!preg_match("/^[a-z0-9]*$/", $class_id)) header("Location: /classes");

// Check login state
require("../../res/php/session.php");
start_session();
Expand Down Expand Up @@ -144,7 +138,6 @@
<div class="class_add">
<div>Add task <i class="fas fa-plus"></i></div>
</div>
<div id="class_id" style="display: none;"><?= $class_id ?></div>
</main>
<script src="https://assets.noten-app.de/js/jquery/jquery-3.6.1.min.js"></script>
<script src="https://assets.noten-app.de/js/themes/themes.js"></script>
Expand Down
7 changes: 0 additions & 7 deletions homework/edit/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<?php

// Check if class url-parameter is given
if (!isset($_GET["class"])) header("Location: /classes");
$class_id = htmlspecialchars($_GET["class"]);
// Check if class is a-z or 0-9
if (!preg_match("/^[a-z0-9]*$/", $class_id)) header("Location: /classes");

// Check login state
require("../../res/php/session.php");
start_session();
Expand Down Expand Up @@ -163,7 +157,6 @@
<div id="task_mark_undone"><i class="fa-regular fa-circle-xmark"></i></div>
<div id="task_delete"><i class="fa-solid fa-trash-can"></i></div>
</div>
<div id="class_id" style="display: none;"><?= $class_id ?></div>
</main>
<script>
var type = "<?= $task["type"] ?>";
Expand Down

0 comments on commit ac54130

Please sign in to comment.