Fixing the email notification formatting in sNews

OK, this one has been bugging the crap out of me lately, so I just fixed it, have you ever received a comment notification email or email from your contact form and it looked like this...

A new comment was posted into your site. Here's a copy:
Name: Bob
Email: Bob@bob.com
Comment:
Hello, I don\'t know what\'s wrong, I can\'t seem to make this mod work on my site.

well, that's the slashes added by magic quotes gpc and they need to be stripped before sending the email.

Here's how we'll do that, first back up your snews.php file and open a copy, now look inside function send_email(), near the end of the function, find;

$body .= $text."\n";

add the following code below it.

// begin new code
if (get_magic_quotes_gpc()) {
    $body = stripslashes($body);
}
// end new code

That will strip those annoying slashes from the text, magic quotes will be removed entirely from PHP 6, so plan accordingly. Cheers.

Share or Bookmark This Post:


Comments

RSS Comments Feed


No comments yet.




(optional, not publicly displayed)


(optional)

Subscribe

RSS Feed

Archives

Powered by HTML5

HTML5 Powered with CSS3 / Styling, Multimedia, and Semantics