Skip to content

Commit

Permalink
Fixed XSS from arcrania
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeLaScala committed Aug 31, 2017
1 parent d31b898 commit 90b633d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion view/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@

header('Location: index.php?action=show_account&username=' . $_SESSION['user']['username']);
} else {
edit_problem($desc, $user_id, $flag, $difficulty, $category, $pid);
edit_problem(htmlspecialchars(nl2br($desc)), $user_id, $flag, $difficulty, $category, $pid);
$_SESSION['edit_challenge'] = "Problem edited successfully!";
header('Location: index.php?action=show_account&username=' . $_SESSION['user']['username']);
}
Expand Down
4 changes: 2 additions & 2 deletions view/show_all_problems_added.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@

<li>
<div class="collapsible-header" style="cursor: default">
<?php echo("<u><a class=\"orange-text\" href=index.php?action=lookup_problem&problem_name=" . str_replace(" ", "%20",$problem['problem_name']) . ">" . $problem['problem_name'] . "</a></u>" . htmlspecialchars(" - " . $problem['username'] . " - " . $problem['difficulty'] . "pts")) ?>
<?php echo("<u><a class=\"orange-text\" href='index.php?action=lookup_problem&problem_name=" . str_replace(" ", "%20",$problem['problem_name']) . "'>" . htmlspecialchars($problem['problem_name']) . "</a></u>" . htmlspecialchars(" - " . $problem['username'] . " - " . $problem['difficulty'] . "pts")) ?>
<span style="float: right"><?php echo(htmlspecialchars($problem['category'] . " " . get_num_solves($problem['problem_id'])) . " " . "solves"); ?>
</span>
</div>
<div class="collapsible-body">
<p>
<?php echo(htmlspecialchars($problem['problem_description'])); ?>
<?php echo($problem['problem_description']); ?>
</p>
<div class="section"></div>

Expand Down

0 comments on commit 90b633d

Please sign in to comment.