Following the question: With "magic quotes" disabled, why does PHP/WordPress continue to auto-escape my POST data?
In WordPress, all superglobals are escaped even if magic quotes are off.
So, following this answer: With "magic quotes" disabled, why does PHP/WordPress continue to auto-escape my POST data?
If I create a plugin and a class to access raw POST, GET, etc., is it a good solution? Do you see any drawbacks, issues whatsoever in such an approach?
Here is my plugin below:
class MyPluginRequest{
public static function getPost( $key ){
global $_REAL_POST;
return isset( $_REAL_POST[ $key ] )? $_REAL_POST[ $key ] : FALSE ;
}
}
// A hack to cope with un-configurable call to wp_magic_quotes
// E.G. Make the original $_POST available through a global $_REAL_POST
global $_REAL_GET, $_REAL_POST, $_REAL_COOKIE, $_REAL_REQUEST;
$_REAL_GET = $_GET;
$_REAL_POST = $_POST;
$_REAL_COOKIE = $_COOKIE;
$_REAL_REQUEST = $_REQUEST;
I then use MyPluginRequest::getPost( 'submit' );
every time I need a posted unescaped value.
Does $wpdb->escape
expect an already magic quoted value or an unescaped one?