Jump to content

Need addslashes() explanation


co.ador

Recommended Posts

The if(function_exists('get_magic_quotes_gpc')) {  code that keldorn posted is nonsense. The get_magic_quotes_gpc function exists in php4, php5, and php6, so that code will always perform stripslashes() even if the magic_quotes_gpc setting is OFF. This will result in any actual \ in the data being removed. stripslashes() should only be executed when magic_quotes_gpc in ON, in which case calling the get_magic_quotes_gpc() function will return a TRUE value.

Are you sure , I learned that from the PHP IPN example from Paypal. If you'll take a look,

https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_admin_IPNImplementation

Why would paypal show a incorrect way to  detect magic quotes. Would of the code example been reviewed before being put on the site?

 

You can learn bad habits from anywhere. (Forums & third party code in particular :) )

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.