Created
June 27, 2013 03:39
-
-
Save sairion/5873763 to your computer and use it in GitHub Desktop.
How to remove trailing slashes in WordPress (or PHP)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from | |
http://fearlessflyer.com/2009/08/getting-rid-of-unwanted-backslashes-in-wordpress-form-input/ | |
<?php | |
//by using stripslashes_deep, you can dodge trailing slash problems in wp_mail or any kind of form-provided contents | |
//before PHP 5.3. | |
if ( get_magic_quotes_gpc() ) { | |
$_POST = array_map( 'stripslashes_deep', $_POST ); | |
$_GET = array_map( 'stripslashes_deep', $_GET ); | |
$_COOKIE = array_map( 'stripslashes_deep', $_COOKIE ); | |
$_REQUEST = array_map( 'stripslashes_deep', $_REQUEST ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment