Changeset 5753
- Timestamp:
- 06/25/2007 06:57:54 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/plugins.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/plugins.php
r5700 r5753 12 12 wp_die(__('Plugin file does not exist.')); 13 13 if (!in_array($plugin, $current)) { 14 wp_redirect( 'plugins.php?error=true'); // we'll override this later if the plugin can be included without fatal error14 wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), 'plugins.php?error=true&plugin=' . $plugin)); // we'll override this later if the plugin can be included without fatal error 15 15 ob_start(); 16 16 @include(ABSPATH . PLUGINDIR . '/' . $plugin); … … 22 22 } 23 23 wp_redirect('plugins.php?activate=true'); // overrides the ?error=true one above 24 } else if ('deactivate' == $_GET['action']) { 24 } elseif ('error_scrape' == $_GET['action']) { 25 $plugin = trim($_GET['plugin']); 26 check_admin_referer('plugin-activation-error_' . $plugin); 27 if ( validate_file($plugin) ) 28 wp_die(__('Invalid plugin.')); 29 if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) ) 30 wp_die(__('Plugin file does not exist.')); 31 include(ABSPATH . PLUGINDIR . '/' . $plugin); 32 } elseif ('deactivate' == $_GET['action']) { 25 33 check_admin_referer('deactivate-plugin_' . $_GET['plugin']); 26 34 $current = get_option('active_plugins'); … … 74 82 75 83 <?php if ( isset($_GET['error']) ) : ?> 76 <div id="message" class="updated fade"><p><?php _e('Plugin could not be activated because it triggered a <strong>fatal error</strong>.') ?></p></div> 84 <div id="message" class="updated fade"><p><?php _e('Plugin could not be activated because it triggered a <strong>fatal error</strong>.') ?></p> 85 <?php 86 $plugin = trim($_GET['plugin']); 87 if ( wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) && 1 == strtolower(ini_get('display_errors'))) { ?> 88 <iframe style="border:0" width="100%" height="70px" src="<?php bloginfo('wpurl'); ?>/wp-admin/plugins.php?action=error_scrape&plugin=<?php echo attribute_escape($plugin); ?>&_wpnonce=<?php echo attribute_escape($_GET['_error_nonce']); ?>"></iframe> 89 <?php 90 } 91 ?> 92 </div> 77 93 <?php elseif ( isset($_GET['activate']) ) : ?> 78 94 <div id="message" class="updated fade"><p><?php _e('Plugin <strong>activated</strong>.') ?></p></div>
Note: See TracChangeset
for help on using the changeset viewer.