Changeset 41399 for trunk/src/wp-admin/plugin-editor.php
- Timestamp:
- 09/19/2017 10:10:35 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/plugin-editor.php
r41376 r41399 38 38 $plugin = ''; 39 39 if ( isset( $_REQUEST['file'] ) ) { 40 $file = sanitize_text_field( $_REQUEST['file'] );40 $file = wp_unslash( $_REQUEST['file'] ); 41 41 } 42 42 43 43 if ( isset( $_REQUEST['plugin'] ) ) { 44 $plugin = sanitize_text_field( $_REQUEST['plugin'] );44 $plugin = wp_unslash( $_REQUEST['plugin'] ); 45 45 } 46 46 … … 108 108 109 109 if ( ( ! empty( $_GET['networkwide'] ) && ! is_plugin_active_for_network( $file ) ) || ! is_plugin_active( $file ) ) { 110 activate_plugin( $plugin, "plugin-editor.php?file= $file&phperror=1", ! empty( $_GET['networkwide'] ) );110 activate_plugin( $plugin, "plugin-editor.php?file=" . urlencode( $file ) . "&phperror=1", ! empty( $_GET['networkwide'] ) ); 111 111 } // we'll override this later if the plugin can be included without fatal error 112 112 113 wp_redirect( self_admin_url( "plugin-editor.php?file=$file&plugin=$plugin&a=te&scrollto=$scrollto") );113 wp_redirect( self_admin_url( 'plugin-editor.php?file=' . urlencode( $file ) . '&plugin=' . urlencode( $plugin ) . "&a=te&scrollto=$scrollto" ) ); 114 114 exit; 115 115 } … … 243 243 if ( is_writeable( $real_file ) ) { 244 244 /* translators: %s: plugin file name */ 245 echo sprintf( __( 'Editing %s (active)' ), '<strong>' . $file. '</strong>' );245 echo sprintf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' ); 246 246 } else { 247 247 /* translators: %s: plugin file name */ 248 echo sprintf( __( 'Browsing %s (active)' ), '<strong>' . $file. '</strong>' );248 echo sprintf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' ); 249 249 } 250 250 } else { 251 251 if ( is_writeable( $real_file ) ) { 252 252 /* translators: %s: plugin file name */ 253 echo sprintf( __( 'Editing %s (inactive)' ), '<strong>' . $file. '</strong>' );253 echo sprintf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' ); 254 254 } else { 255 255 /* translators: %s: plugin file name */ 256 echo sprintf( __( 'Browsing %s (inactive)' ), '<strong>' . $file. '</strong>' );256 echo sprintf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' ); 257 257 } 258 258 } … … 299 299 } 300 300 ?> 301 <li<?php echo $file == $plugin_file ? ' class="highlight"' : ''; ?>><a href="plugin-editor.php?file=<?php echo urlencode( $plugin_file ) ?>&plugin=<?php echo urlencode( $plugin ) ?>"><?php echo $plugin_file?></a></li>301 <li<?php echo $file == $plugin_file ? ' class="highlight"' : ''; ?>><a href="plugin-editor.php?file=<?php echo urlencode( $plugin_file ) ?>&plugin=<?php echo urlencode( $plugin ) ?>"><?php echo esc_html( $plugin_file ); ?></a></li> 302 302 <?php endforeach; ?> 303 303 </ul>
Note: See TracChangeset
for help on using the changeset viewer.