This is more of a curiosity than anything. The comment system on my site automatically generates an email to me whenever a comment is sent. It has a link to approve the comment, and a link to reject 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 when 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 that I get in the email is sent
http://www.mysite.com/edit/instaprove.ph%20p?Approve=Approve&commentid=142631
Strange, no?
Edit: for clarification. When this happens, the link is correctly written in the letter ( .php ), but the link to which it goes is broken ( .ph p ).
Edit 8/12: This happened again. Link text is correct:
http://www.mysite.com/edit/instaprove.php?Approve=Approve&commentid=142858
but the link appears as
http://www.mysite.com/edit/%20instaprove.php?Approve=Approve&commentid=142858
So, when it appears, a secret space appears at different points of the link.