Fixing the email notification formatting in sNews

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.

Tags

 

You might like

Comments

No comments have been posted to this page.

Comments are closed. No new comments allowed.

Copyleft 2002 - 2017 Matt Jones
Hand crafted with HTML5 & CSS3
↑ Back to top