Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().

git-svn-id: https://develop.svn.wordpress.org/trunk@23567 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2013-03-01 17:14:09 +00:00
parent 316689c934
commit 436b32ef62
20 changed files with 51 additions and 52 deletions

View File

@@ -28,7 +28,7 @@ if ( empty($plugins) )
wp_die( __('There are no plugins installed on this site.') );
if ( isset($_REQUEST['file']) )
$plugin = stripslashes($_REQUEST['file']);
$plugin = wp_unslash($_REQUEST['file']);
if ( empty($plugin) ) {
$plugin = array_keys($plugins);
@@ -39,8 +39,6 @@ $plugin_files = get_plugin_files($plugin);
if ( empty($file) )
$file = $plugin_files[0];
else
$file = stripslashes($file);
$file = validate_file_to_edit($file, $plugin_files);
$real_file = WP_PLUGIN_DIR . '/' . $file;
@@ -52,7 +50,7 @@ case 'update':
check_admin_referer('edit-plugin_' . $file);
$newcontent = stripslashes($_POST['newcontent']);
$newcontent = wp_unslash( $_POST['newcontent'] );
if ( is_writeable($real_file) ) {
$f = fopen($real_file, 'w+');
fwrite($f, $newcontent);