- Timestamp:
- 06/21/2013 05:54:40 AM (12 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-upgrader.php
r24313 r24474 100 100 default: 101 101 if ( ! $wp_filesystem->find_folder($dir) ) 102 return new WP_Error( 'fs_no_folder', sprintf($this->strings['fs_no_folder'], $dir));102 return new WP_Error( 'fs_no_folder', sprintf( $this->strings['fs_no_folder'], esc_html( basename( $dir ) ) ) ); 103 103 break; 104 104 } … … 1145 1145 foreach ( $errors->get_error_messages() as $message ) { 1146 1146 if ( $errors->get_error_data() ) 1147 $this->feedback($message . ' ' . $errors->get_error_data() );1147 $this->feedback($message . ' ' . esc_html( $errors->get_error_data() ) ); 1148 1148 else 1149 1149 $this->feedback($message); … … 1159 1159 $args = func_get_args(); 1160 1160 $args = array_splice($args, 1); 1161 if ( !empty($args) ) 1161 if ( $args ) { 1162 $args = array_map( 'strip_tags', $args ); 1163 $args = array_map( 'esc_html', $args ); 1162 1164 $string = vsprintf($string, $args); 1165 } 1163 1166 } 1164 1167 if ( empty($string) ) … … 1200 1203 $this->plugin = $this->upgrader->plugin_info(); 1201 1204 if ( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){ 1202 echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) .'"></iframe>';1205 echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin) .'"></iframe>'; 1203 1206 } 1204 1207 1205 1208 $update_actions = array( 1206 'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>',1209 'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>', 1207 1210 'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>' 1208 1211 ); … … 1256 1259 $args = func_get_args(); 1257 1260 $args = array_splice($args, 1); 1258 if ( !empty($args) ) 1261 if ( $args ) { 1262 $args = array_map( 'strip_tags', $args ); 1263 $args = array_map( 'esc_html', $args ); 1259 1264 $string = vsprintf($string, $args); 1265 } 1260 1266 } 1261 1267 if ( empty($string) ) … … 1281 1287 foreach ( $error->get_error_messages() as $emessage ) { 1282 1288 if ( $error->get_error_data() ) 1283 $messages[] = $emessage . ' ' . $error->get_error_data();1289 $messages[] = $emessage . ' ' . esc_html( $error->get_error_data() ); 1284 1290 else 1285 1291 $messages[] = $emessage; … … 1443 1449 1444 1450 if ( 'import' == $from ) 1445 $install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&from=import&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin & Run Importer') . '</a>';1451 $install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&from=import&plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin & Run Importer') . '</a>'; 1446 1452 else 1447 $install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>';1453 $install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>'; 1448 1454 1449 1455 if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) { 1450 $install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';1456 $install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>'; 1451 1457 unset( $install_actions['activate_plugin'] ); 1452 1458 } -
trunk/wp-admin/update.php
r23554 r24474 58 58 59 59 $nonce = 'upgrade-plugin_' . $plugin; 60 $url = 'update.php?action=upgrade-plugin&plugin=' . $plugin;60 $url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin ); 61 61 62 62 $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) ); … … 71 71 check_admin_referer('activate-plugin_' . $plugin); 72 72 if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) { 73 wp_redirect( admin_url('update.php?action=activate-plugin&failure=true&plugin=' . $plugin. '&_wpnonce=' . $_GET['_wpnonce']) );73 wp_redirect( admin_url('update.php?action=activate-plugin&failure=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce']) ); 74 74 activate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ), true ); 75 wp_redirect( admin_url('update.php?action=activate-plugin&success=true&plugin=' . $plugin. '&_wpnonce=' . $_GET['_wpnonce']) );75 wp_redirect( admin_url('update.php?action=activate-plugin&success=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce']) ); 76 76 die(); 77 77 } … … 108 108 $title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version ); 109 109 $nonce = 'install-plugin_' . $plugin; 110 $url = 'update.php?action=install-plugin&plugin=' . $plugin;110 $url = 'update.php?action=install-plugin&plugin=' . urlencode( $plugin ); 111 111 if ( isset($_GET['from']) ) 112 112 $url .= '&from=' . urlencode(stripslashes($_GET['from'])); … … 133 133 require_once(ABSPATH . 'wp-admin/admin-header.php'); 134 134 135 $title = sprintf( __('Installing Plugin from uploaded file: %s'), basename( $file_upload->filename) );135 $title = sprintf( __('Installing Plugin from uploaded file: %s'), esc_html( basename( $file_upload->filename ) ) ); 136 136 $nonce = 'plugin-upload'; 137 137 $url = add_query_arg(array('package' => $file_upload->id), 'update.php?action=upload-plugin'); … … 161 161 162 162 $nonce = 'upgrade-theme_' . $theme; 163 $url = 'update.php?action=upgrade-theme&theme=' . $theme;163 $url = 'update.php?action=upgrade-theme&theme=' . urlencode( $theme ); 164 164 165 165 $upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact('title', 'nonce', 'url', 'theme') ) ); … … 214 214 $title = sprintf( __('Installing Theme: %s'), $api->name . ' ' . $api->version ); 215 215 $nonce = 'install-theme_' . $theme; 216 $url = 'update.php?action=install-theme&theme=' . $theme;216 $url = 'update.php?action=install-theme&theme=' . urlencode( $theme ); 217 217 $type = 'web'; //Install theme type, From Web or an Upload. 218 218 … … 239 239 require_once(ABSPATH . 'wp-admin/admin-header.php'); 240 240 241 $title = sprintf( __('Installing Theme from uploaded file: %s'), basename( $file_upload->filename) );241 $title = sprintf( __('Installing Theme from uploaded file: %s'), esc_html( basename( $file_upload->filename ) ) ); 242 242 $nonce = 'theme-upload'; 243 243 $url = add_query_arg(array('package' => $file_upload->id), 'update.php?action=upload-theme');
Note: See TracChangeset
for help on using the changeset viewer.