diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
commit | 3a4570b0fc8b3d6339bef71d17d7701554e0bbf7 (patch) | |
tree | 2a06e5261263c68d8afd95a6328879dc289cb909 /wp-admin/plugins.php | |
parent | b83c34a7010faee0223f6037025c350da12e05e6 (diff) | |
download | wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.gz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.xz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.zip |
Merge with WP 2.3 - testing use only!
Move pluggable functions out of wpmu-functions and into pluggable.php, fixes #439
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1069 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/plugins.php')
-rw-r--r-- | wp-admin/plugins.php | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 885994b..d2c7d48 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -18,7 +18,7 @@ if ( isset($_GET['action']) ) { if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) ) wp_die(__('Plugin file does not exist.')); if (!in_array($plugin, $current)) { - wp_redirect('plugins.php?error=true'); // we'll override this later if the plugin can be included without fatal error + 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 ob_start(); @include(ABSPATH . PLUGINDIR . '/' . $plugin); $current[] = $plugin; @@ -28,7 +28,15 @@ if ( isset($_GET['action']) ) { ob_end_clean(); } wp_redirect('plugins.php?activate=true'); // overrides the ?error=true one above - } else if ('deactivate' == $_GET['action']) { + } elseif ('error_scrape' == $_GET['action']) { + $plugin = trim($_GET['plugin']); + check_admin_referer('plugin-activation-error_' . $plugin); + if ( validate_file($plugin) ) + wp_die(__('Invalid plugin.')); + if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) ) + wp_die(__('Plugin file does not exist.')); + include(ABSPATH . PLUGINDIR . '/' . $plugin); + } elseif ('deactivate' == $_GET['action']) { check_admin_referer('deactivate-plugin_' . $_GET['plugin']); $current = get_option('active_plugins'); array_splice($current, array_search( $_GET['plugin'], $current), 1 ); // Array-fu! @@ -38,12 +46,12 @@ if ( isset($_GET['action']) ) { } elseif ($_GET['action'] == 'deactivate-all') { check_admin_referer('deactivate-all'); $current = get_option('active_plugins'); - + foreach ($current as $plugin) { array_splice($current, array_search($plugin, $current), 1); do_action('deactivate_' . $plugin); } - + update_option('active_plugins', array()); wp_redirect('plugins.php?deactivate-all=true'); } @@ -80,7 +88,15 @@ foreach ($check_plugins as $check_plugin) { ?> <?php if ( isset($_GET['error']) ) : ?> - <div id="message" class="updated fade"><p><?php _e('Plugin could not be activated because it triggered a <strong>fatal error</strong>.') ?></p></div> + <div id="message" class="updated fade"><p><?php _e('Plugin could not be activated because it triggered a <strong>fatal error</strong>.') ?></p> + <?php + $plugin = trim($_GET['plugin']); + if ( wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) && 1 == strtolower(ini_get('display_errors'))) { ?> + <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> + <?php + } + ?> + </div> <?php elseif ( isset($_GET['activate']) ) : ?> <div id="message" class="updated fade"><p><?php _e('Plugin <strong>activated</strong>.') ?></p></div> <?php elseif ( isset($_GET['deactivate']) ) : ?> @@ -142,7 +158,7 @@ if (empty($plugins)) { <tr $style> <td class='name'>{$plugin_data['Title']}</td> <td class='vers'>{$plugin_data['Version']}</td> - <td class='desc'><p>{$plugin_data['Description']} <cite>".sprintf(__('By %s'), $plugin_data['Author']).".</cite></p></td> + <td class='desc'><p>{$plugin_data['Description']}$author</p></td> <td class='togl'>$toggle</td>"; echo" </tr>"; |