php - WordPress plugins and problem with magic_quotes_gpc -
I want to write some plugins that add form to the admin panel and in the blog post, now I am struggling with Magic_Quotes .
I first tried to use Magic_quotes_gpc as a clear PHP. But it seems that WordPress ignores this flag and always submits the form content (at least in the form of the form, the forms are not quoted in the administration panel).
But then I'm uploading my plugin to DreamHost and it is
Actually, you (probably) think about a different PHP configuration between your development environment and Dreamhost, I think you want your plug-in to handle both scenarios: magic_quotes on and off here There are some ideas / ideas.
-
You can not always change the php.ini settings on runtime - this depends on the server configuration.
-
You can not always change php.ini either. , But unsupported.
-
You can find out that magic_quotes have been activated with.
-
magic_quotes_gpc Essentially runs on all GET, POST, and cookie data
-
You can perform an inverse operation with Are there.
A common technique is to write a simple wrapper utility parameter (GET / POST / COOKIE), such as:
function myplugin_param ( $ Name) {if (ini_get ('magic_quotes_gpc')) {return stripsSash ($ _ request [$ name]); } Return $ _REQUEST [$ name]; }
Hope that helps!
Comments
Post a Comment