Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

New addslash/stripslash functions explained.

New addslash/stripslash functions explained.
Confused by the addition of the two new core functions addslash() and stripslash(). These functions are not intended to fully replace php's addslashes() or stripslashes(). stripslash() checks if magic_quotes_gpc is enabled before actually removing any escape slashes, whilst addslash() adds the correct amount of escape slashes which is ideal prior to inserting text into the database. On the other hand stripslashes() is still used whenever we recall data from the database which contains quotes or single quotes, e.g. HTML, PHP, or unsanitised text such as news. If you store data which has been sanitised using PHPFusion's stripinput() function then there is no need to stripslashes as quotes and single quotes are replaced with character codes.

Here's the typical use of stripslashes(), stripslash() & addslash() in the news.pho admin panel
Preview news: stripslash($_POST['news_body']);
Save News: addslash($_POST['news_body']);
Fetch news from db: stripslashes($data['news_body']);

Falk March 03 2005 17,380