title: PHP: Is it a good idea to add quotes to all $_GET & $_POST?
body: <p>In Wordpress, I notice they have a function called <code>wp_magic_quotes()</code> (<a href="http://codex.wordpress.org/Function_Reference/wp_magic_quotes" rel="nofollow">docs</a>).</p>
  
  <p>Here's an example:</p>
  
  <pre><code>// If already slashed, strip.
  if ( get_magic_quotes_gpc() ) {
      $_GET    = stripslashes_deep( $_GET    );
      $_POST   = stripslashes_deep( $_POST   );
      $_COOKIE = stripslashes_deep( $_COOKIE );
  }
  
  // Escape with wpdb.
  $_GET    = add_magic_quotes( $_GET    );
  $_POST   = add_magic_quotes( $_POST   );
  $_COOKIE = add_magic_quotes( $_COOKIE );
  $_SERVER = add_magic_quotes( $_SERVER );
  </code></pre>
  
  <p>In my own code (separate from Wordpress), is there any benefit to doing this? Any security benefits? </p>
  
  <p>Perhaps Wordpress do this because their software is used on so many environments they need to make them consistent.</p>
  
  <p>My software is on a single environment and I'm using a PDO connection for my database which is already escaping data. </p>
  
  <p>I'm just trying to work out if there's any benefit to doing this sort of thing.</p>