Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitizing user input #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
3 changes: 2 additions & 1 deletion RelativePath.Example1.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ function execTime($function, $title="", $iterations = 100000) {
<form method="post">
<p>Path:<br />
<input type="text" size="120" name="path"
value="<?php echo stripslashes($_POST['path']); ?>" /></p>
value="<?php echo htmlspecialchars(stripslashes($_POST['path']), ENT_QUOTES); ?>" /></p>
<p><input type="submit" /></p>
</form>
<dl>
<?php
foreach ($paths as $path) {
$path = htmlspecialchars($path, ENT_QUOTES);
echo "<dt><pre>Path '$path' becomes:</pre></dt>\n";
echo "<dd><pre>";
echo "'" . RelativePath::getRelativePath($path) . "'\n";
Expand Down