This is more of a curiosity than anything. The comment system on my site automatically generates an email to me whenever a comment is posted. In it is a link to approve the comment, and a link to deny the comment.
$my_headers = 'MIME-Version: 1.0' . "\n";
$my_headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
$my_headers .= 'From: MYSITE.com <ealert@mysite.com>' . "\n";
$subject = "Comment Received";
$messagei = "Comment from " . addslashes($_POST['commentName']) ." on ".addslashes($title)."." . "<br /><br />" .addslashes($commentCommment);
$messagei .= "<br /><br />
<strong>OPTIONS:</strong>
<br /><br /><a href='http://www.MYSITE.com/edit/instaprove.php?Approve=Approve&commentid=".$lastID."'>
<h2>http://www.MYSITE.com/edit/instaprove.php?Approve=Approve&commentid=".$lastID."</h2> (Approve Comment)</a>
<br /><br /><br /><a href='http://www.MYSITE.com/edit/instaprove.php?Remove=Remove&commentid=".$lastID."'>
<h2>http://www.MYSITE.com/edit/instaprove.php?Remove=Remove&commentid=".$lastID."</h2> (Delete Comment)</a>";
mail('comments@mysite.com',$subject,$messagei,$my_headers,"-fealert@mysite.com");
99% of the time it works just fine, but every once in a while, instead of generating the approval link correctly, as in
http://www.mysite.com/edit/instaprove.php?Approve=Approve&commentid=142631
,
it generates it with a space in it, so the link I get in the email goes to
http://www.mysite.com/edit/instaprove.ph%20p?Approve=Approve&commentid=142631
Strange, no?
Edit: For clarification - When this happens, the link is written out in the email correctly (.php
), but the link it goes to is broken (.ph p
).
Edit 8/12: It just happened again. The link text is correct:
http://www.mysite.com/edit/instaprove.php?Approve=Approve&commentid=142858
but the link renders as
http://www.mysite.com/edit/%20instaprove.php?Approve=Approve&commentid=142858
So, when it does show up, the mystery space is showing up at different points in the link.