diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-03-11 19:15:04 +0100 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-03-11 19:15:04 +0100 |
commit | 9b112a56d0e3c93e062d1382527a27fc44518916 (patch) | |
tree | ef9be27f1235fb01562f8adbdf6660a2c45bcce0 /web/template/pkg_details.php | |
parent | 7f9e498e48c4e5d056ee988a23dedb8ca98b11cd (diff) |
Fix XSS vulnerability in package search results and package details.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/template/pkg_details.php')
-rw-r--r-- | web/template/pkg_details.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 3b96791..eac7b69 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -29,7 +29,7 @@ else { if ($row["SubmitterUID"]) { $submitter = username_from_id($row["SubmitterUID"]); if ($SID) { - $submitter = '<a href="account.php?Action=AccountInfo&ID=' . $row['SubmitterUID'] . '">' . $submitter . '</a>'; + $submitter = '<a href="account.php?Action=AccountInfo&ID=' . htmlspecialchars($row['SubmitterUID'], ENT_QUOTES) . '">' . htmlspecialchars($submitter) . '</a>'; } } else { @@ -39,7 +39,7 @@ if ($row["SubmitterUID"]) { if ($row["MaintainerUID"]) { $maintainer = username_from_id($row["MaintainerUID"]); if ($SID) { - $maintainer = '<a href="account.php?Action=AccountInfo&ID=' . $row['MaintainerUID'] . '">' . $maintainer . '</a>'; + $maintainer = '<a href="account.php?Action=AccountInfo&ID=' . htmlspecialchars($row['MaintainerUID'], ENT_QUOTES) . '">' . htmlspecialchars($maintainer) . '</a>'; } } else { @@ -66,8 +66,8 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("r", intval($row[ <div class="pgboxbody"> <p> - <span class='f2'><?php echo $row['Name'] . ' ' . $row['Version'] ?></span><br /> - <span class='f3'><a href="<?php echo $row['URL'] . '">' . $row['URL'] ?></a></span><br /> + <span class='f2'><?php echo htmlspecialchars($row['Name']) . ' ' . htmlspecialchars($row['Version']) ?></span><br /> + <span class='f3'><a href="<?php echo htmlspecialchars($row['URL'], ENT_QUOTES) . '">' . $row['URL'] ?></a></span><br /> <span class='f3'><?php echo htmlspecialchars($row['Description'], ENT_QUOTES); ?></span> </p> @@ -79,7 +79,7 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("r", intval($row[ <span class='f3'><?php echo $votes ?></span> </p> - <p><span class='f3'><?php echo __('License') . ': ' . $license ?></span></p> + <p><span class='f3'><?php echo __('License') . ': ' . htmlspecialchars($license) ?></span></p> <p> <span class='f3'> @@ -161,12 +161,12 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("r", intval($row[ if (isset($parsed_url['scheme']) || isset($src[1])) { # It is an external source - echo "<a href=\"" . (isset($src[1]) ? $src[1] : $src[0]) . "\">{$src[0]}</a><br />\n"; + echo "<a href=\"" . htmlspecialchars((isset($src[1]) ? $src[1] : $src[0]), ENT_QUOTES) . "\">" . htmlspecialchars($src[0]) . "</a><br />\n"; } else { $src = $src[0]; # It is presumably an internal source - echo "<span class='f8'>$src</span>"; + echo "<span class='f8'>" . htmlspecialchars($src) . "</span>"; echo "<br />\n"; } } |