mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-09 15:14:37 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user