Use urlencode instead of htmlspecialchars

This commit is contained in:
Yarmo Mackenbach 2020-07-01 14:42:19 +02:00
parent 146385609c
commit 34cb9a073c
3 changed files with 7 additions and 7 deletions

View file

@ -1,7 +1,7 @@
<?php <?php
$fingerprint = htmlspecialchars($_GET["fp"]); $fingerprint = urlencode($_GET["fp"]);
$user = htmlspecialchars($_GET["user"]); $user = urlencode($_GET["user"]);
$url = "https://lobste.rs/u/$user.json"; $url = "https://lobste.rs/u/$user.json";
$check = "\[Verifying my OpenPGP key: openpgp4fpr:$fingerprint\]"; $check = "\[Verifying my OpenPGP key: openpgp4fpr:$fingerprint\]";

View file

@ -1,8 +1,8 @@
<?php <?php
$fingerprint = htmlspecialchars($_GET["fp"]); $fingerprint = urlencode($_GET["fp"]);
$user = htmlspecialchars($_GET["user"]); $user = urlencode($_GET["user"]);
$comment = htmlspecialchars($_GET["comment"]); $comment = urlencode($_GET["comment"]);
$url = "https://www.reddit.com/user/$user/comments/$comment.json"; $url = "https://www.reddit.com/user/$user/comments/$comment.json";
$check = "\[Verifying my OpenPGP key: openpgp4fpr:$fingerprint\\\\\]"; $check = "\[Verifying my OpenPGP key: openpgp4fpr:$fingerprint\\\\\]";

View file

@ -2,8 +2,8 @@
include 'secrets.php'; include 'secrets.php';
$fingerprint = htmlspecialchars($_GET["fp"]); $fingerprint = urlencode($_GET["fp"]);
$tweetId = htmlspecialchars($_GET["id"]); $tweetId = urlencode($_GET["id"]);
$check = "\[Verifying my OpenPGP key: openpgp4fpr:$fingerprint\]"; $check = "\[Verifying my OpenPGP key: openpgp4fpr:$fingerprint\]";