diff --git a/src/wp-admin/includes/class-wp-plugins-list-table.php b/src/wp-admin/includes/class-wp-plugins-list-table.php index 7073e79051..565cb4b951 100644 --- a/src/wp-admin/includes/class-wp-plugins-list-table.php +++ b/src/wp-admin/includes/class-wp-plugins-list-table.php @@ -598,16 +598,16 @@ class WP_Plugins_List_Table extends WP_List_Table { if ( $is_active ) { if ( current_user_can( 'manage_network_plugins' ) ) { /* translators: %s: plugin name */ - $actions['deactivate'] = '' . __( 'Network Deactivate' ) . ''; + $actions['deactivate'] = '' . __( 'Network Deactivate' ) . ''; } } else { if ( current_user_can( 'manage_network_plugins' ) ) { /* translators: %s: plugin name */ - $actions['activate'] = '' . __( 'Network Activate' ) . ''; + $actions['activate'] = '' . __( 'Network Activate' ) . ''; } if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) { /* translators: %s: plugin name */ - $actions['delete'] = '' . __( 'Delete' ) . ''; + $actions['delete'] = '' . __( 'Delete' ) . ''; } } } else { @@ -622,17 +622,17 @@ class WP_Plugins_List_Table extends WP_List_Table { } elseif ( $is_active ) { if ( current_user_can( 'deactivate_plugin', $plugin_file ) ) { /* translators: %s: plugin name */ - $actions['deactivate'] = '' . __( 'Deactivate' ) . ''; + $actions['deactivate'] = '' . __( 'Deactivate' ) . ''; } } else { if ( current_user_can( 'activate_plugin', $plugin_file ) ) { /* translators: %s: plugin name */ - $actions['activate'] = '' . __( 'Activate' ) . ''; + $actions['activate'] = '' . __( 'Activate' ) . ''; } if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) { /* translators: %s: plugin name */ - $actions['delete'] = '' . __( 'Delete' ) . ''; + $actions['delete'] = '' . __( 'Delete' ) . ''; } } // end if $is_active diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 4846fcd906..7d5e0536f5 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -772,7 +772,7 @@ function page_template_dropdown( $default = '', $post_type = 'page' ) { ksort( $templates ); foreach ( array_keys( $templates ) as $template ) { $selected = selected( $default, $templates[ $template ], false ); - echo "\n\t"; + echo "\n\t"; } } diff --git a/src/wp-admin/plugin-editor.php b/src/wp-admin/plugin-editor.php index 9816a5d48c..14d2b65039 100644 --- a/src/wp-admin/plugin-editor.php +++ b/src/wp-admin/plugin-editor.php @@ -37,11 +37,11 @@ if ( empty( $plugins ) ) { $file = ''; $plugin = ''; if ( isset( $_REQUEST['file'] ) ) { - $file = sanitize_text_field( $_REQUEST['file'] ); + $file = wp_unslash( $_REQUEST['file'] ); } if ( isset( $_REQUEST['plugin'] ) ) { - $plugin = sanitize_text_field( $_REQUEST['plugin'] ); + $plugin = wp_unslash( $_REQUEST['plugin'] ); } if ( empty( $plugin ) ) { @@ -107,10 +107,10 @@ if ( isset( $_REQUEST['action'] ) && 'update' === $_REQUEST['action'] ) { } if ( ( ! empty( $_GET['networkwide'] ) && ! is_plugin_active_for_network( $file ) ) || ! is_plugin_active( $file ) ) { - activate_plugin( $plugin, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) ); + activate_plugin( $plugin, "plugin-editor.php?file=" . urlencode( $file ) . "&phperror=1", ! empty( $_GET['networkwide'] ) ); } // we'll override this later if the plugin can be included without fatal error - wp_redirect( self_admin_url("plugin-editor.php?file=$file&plugin=$plugin&a=te&scrollto=$scrollto") ); + wp_redirect( self_admin_url( 'plugin-editor.php?file=' . urlencode( $file ) . '&plugin=' . urlencode( $plugin ) . "&a=te&scrollto=$scrollto" ) ); exit; } @@ -242,18 +242,18 @@ if ( isset( $_REQUEST['action'] ) && 'update' === $_REQUEST['action'] ) { if ( is_plugin_active( $plugin ) ) { if ( is_writeable( $real_file ) ) { /* translators: %s: plugin file name */ - echo sprintf( __( 'Editing %s (active)' ), '' . $file . '' ); + echo sprintf( __( 'Editing %s (active)' ), '' . esc_html( $file ) . '' ); } else { /* translators: %s: plugin file name */ - echo sprintf( __( 'Browsing %s (active)' ), '' . $file . '' ); + echo sprintf( __( 'Browsing %s (active)' ), '' . esc_html( $file ) . '' ); } } else { if ( is_writeable( $real_file ) ) { /* translators: %s: plugin file name */ - echo sprintf( __( 'Editing %s (inactive)' ), '' . $file . '' ); + echo sprintf( __( 'Editing %s (inactive)' ), '' . esc_html( $file ) . '' ); } else { /* translators: %s: plugin file name */ - echo sprintf( __( 'Browsing %s (inactive)' ), '' . $file . '' ); + echo sprintf( __( 'Browsing %s (inactive)' ), '' . esc_html( $file ) . '' ); } } ?> @@ -298,7 +298,7 @@ foreach ( $plugin_files as $plugin_file ) : continue; } ?> -