mirror of
git://develop.git.wordpress.org/
synced 2025-01-18 05:18:42 +01:00
Use Absolute URL's in header redirects in wp-admin/plugin.php. See #14062
git-svn-id: https://develop.svn.wordpress.org/trunk@16006 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8e7e99047e
commit
3c4cd0b408
@ -32,10 +32,10 @@ if ( $action ) {
|
|||||||
|
|
||||||
check_admin_referer('activate-plugin_' . $plugin);
|
check_admin_referer('activate-plugin_' . $plugin);
|
||||||
|
|
||||||
$result = activate_plugin($plugin, 'plugins.php?error=true&plugin=' . $plugin, $network_wide);
|
$result = activate_plugin($plugin, admin_url('plugins.php?error=true&plugin=' . $plugin), $network_wide);
|
||||||
if ( is_wp_error( $result ) ) {
|
if ( is_wp_error( $result ) ) {
|
||||||
if ( 'unexpected_output' == $result->get_error_code() ) {
|
if ( 'unexpected_output' == $result->get_error_code() ) {
|
||||||
$redirect = 'plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s";
|
$redirect = admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s");
|
||||||
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
|
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
@ -49,9 +49,9 @@ if ( $action ) {
|
|||||||
update_option('recently_activated', $recent);
|
update_option('recently_activated', $recent);
|
||||||
}
|
}
|
||||||
if ( isset($_GET['from']) && 'import' == $_GET['from'] ) {
|
if ( isset($_GET['from']) && 'import' == $_GET['from'] ) {
|
||||||
wp_redirect("import.php?import=" . str_replace('-importer', '', dirname($plugin)) ); // overrides the ?error=true one above and redirects to the Imports page, striping the -importer suffix
|
wp_redirect( admin_url("import.php?import=" . str_replace('-importer', '', dirname($plugin))) ); // overrides the ?error=true one above and redirects to the Imports page, striping the -importer suffix
|
||||||
} else {
|
} else {
|
||||||
wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s"); // overrides the ?error=true one above
|
wp_redirect( admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
break;
|
break;
|
||||||
@ -65,11 +65,11 @@ if ( $action ) {
|
|||||||
$plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
|
$plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
|
||||||
$plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); // Only activate plugins which are not already active.
|
$plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); // Only activate plugins which are not already active.
|
||||||
if ( empty($plugins) ) {
|
if ( empty($plugins) ) {
|
||||||
wp_redirect("plugins.php?plugin_status=$status&paged=$page&s=$s");
|
wp_redirect( admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
activate_plugins($plugins, 'plugins.php?error=true', $network_wide);
|
activate_plugins($plugins, admin_url('plugins.php?error=true'), $network_wide);
|
||||||
|
|
||||||
$recent = (array)get_option('recently_activated');
|
$recent = (array)get_option('recently_activated');
|
||||||
foreach ( $plugins as $plugin => $time)
|
foreach ( $plugins as $plugin => $time)
|
||||||
@ -78,7 +78,7 @@ if ( $action ) {
|
|||||||
|
|
||||||
update_option('recently_activated', $recent);
|
update_option('recently_activated', $recent);
|
||||||
|
|
||||||
wp_redirect("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s");
|
wp_redirect( admin_url("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s") );
|
||||||
exit;
|
exit;
|
||||||
break;
|
break;
|
||||||
case 'update-selected' :
|
case 'update-selected' :
|
||||||
@ -102,7 +102,7 @@ if ( $action ) {
|
|||||||
echo '<h2>' . esc_html( $title ) . '</h2>';
|
echo '<h2>' . esc_html( $title ) . '</h2>';
|
||||||
|
|
||||||
|
|
||||||
$url = 'update.php?action=update-selected&plugins=' . urlencode( join(',', $plugins) );
|
$url = admin_url('update.php?action=update-selected&plugins=' . urlencode( join(',', $plugins) ));
|
||||||
$url = wp_nonce_url($url, 'bulk-update-plugins');
|
$url = wp_nonce_url($url, 'bulk-update-plugins');
|
||||||
|
|
||||||
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
|
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
|
||||||
@ -143,10 +143,10 @@ if ( $action ) {
|
|||||||
check_admin_referer('deactivate-plugin_' . $plugin);
|
check_admin_referer('deactivate-plugin_' . $plugin);
|
||||||
deactivate_plugins($plugin);
|
deactivate_plugins($plugin);
|
||||||
update_option('recently_activated', array($plugin => time()) + (array)get_option('recently_activated'));
|
update_option('recently_activated', array($plugin => time()) + (array)get_option('recently_activated'));
|
||||||
if (headers_sent())
|
if ( headers_sent() )
|
||||||
echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) . "' />";
|
echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) . "' />";
|
||||||
else
|
else
|
||||||
wp_redirect("plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s");
|
wp_redirect( admin_url("plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s") );
|
||||||
exit;
|
exit;
|
||||||
break;
|
break;
|
||||||
case 'deactivate-selected':
|
case 'deactivate-selected':
|
||||||
@ -158,7 +158,7 @@ if ( $action ) {
|
|||||||
$plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
|
$plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
|
||||||
$plugins = array_filter($plugins, 'is_plugin_active'); //Do not deactivate plugins which are already deactivated.
|
$plugins = array_filter($plugins, 'is_plugin_active'); //Do not deactivate plugins which are already deactivated.
|
||||||
if ( empty($plugins) ) {
|
if ( empty($plugins) ) {
|
||||||
wp_redirect("plugins.php?plugin_status=$status&paged=$page&s=$s");
|
wp_redirect( admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ if ( $action ) {
|
|||||||
$deactivated[ $plugin ] = time();
|
$deactivated[ $plugin ] = time();
|
||||||
|
|
||||||
update_option('recently_activated', $deactivated + (array)get_option('recently_activated'));
|
update_option('recently_activated', $deactivated + (array)get_option('recently_activated'));
|
||||||
wp_redirect("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s");
|
wp_redirect( admin_url("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s") );
|
||||||
exit;
|
exit;
|
||||||
break;
|
break;
|
||||||
case 'delete-selected':
|
case 'delete-selected':
|
||||||
@ -182,7 +182,7 @@ if ( $action ) {
|
|||||||
$plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
|
$plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
|
||||||
$plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Do not allow to delete Activated plugins.
|
$plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Do not allow to delete Activated plugins.
|
||||||
if ( empty($plugins) ) {
|
if ( empty($plugins) ) {
|
||||||
wp_redirect("plugins.php?plugin_status=$status&paged=$page&s=$s");
|
wp_redirect( admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,8 +275,8 @@ if ( $action ) {
|
|||||||
} //Endif verify-delete
|
} //Endif verify-delete
|
||||||
$delete_result = delete_plugins($plugins);
|
$delete_result = delete_plugins($plugins);
|
||||||
|
|
||||||
set_transient('plugins_delete_result_'.$user_ID, $delete_result); //Store the result in a cache rather than a URL param due to object type & length
|
set_transient('plugins_delete_result_' . $user_ID, $delete_result); //Store the result in a cache rather than a URL param due to object type & length
|
||||||
wp_redirect("plugins.php?deleted=true&plugin_status=$status&paged=$page&s=$s");
|
wp_redirect( admin_url("plugins.php?deleted=true&plugin_status=$status&paged=$page&s=$s") );
|
||||||
exit;
|
exit;
|
||||||
break;
|
break;
|
||||||
case 'clear-recent-list':
|
case 'clear-recent-list':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user