mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Themes: Do extra Cap checks before outputting links, and use full URI's. See #25948
git-svn-id: https://develop.svn.wordpress.org/trunk@26470 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -142,7 +142,7 @@ function get_theme_update_available( $theme ) {
|
||||
$update = $themes_update->response[ $stylesheet ];
|
||||
$theme_name = $theme->display('Name');
|
||||
$details_url = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']); //Theme browser inside WP? replace this, Also, theme preview JS will override this on the available list.
|
||||
$update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet);
|
||||
$update_url = wp_nonce_url( admin_url( 'update.php?action=upgrade-theme&theme=' . urlencode( $stylesheet ) ), 'upgrade-theme_' . $stylesheet );
|
||||
$update_onclick = 'onclick="if ( confirm(\'' . esc_js( __("Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.") ) . '\') ) {return true;}return false;"';
|
||||
|
||||
if ( !is_multisite() ) {
|
||||
@@ -414,9 +414,9 @@ function wp_prepare_themes_for_js( $themes = null ) {
|
||||
'hasUpdate' => isset( $updates[ $slug ] ),
|
||||
'update' => get_theme_update_available( $theme ),
|
||||
'actions' => array(
|
||||
'activate' => wp_nonce_url( 'themes.php?action=activate&stylesheet=' . $encoded_slug, 'switch-theme_' . $slug ),
|
||||
'customize'=> admin_url( 'customize.php?theme=' . $encoded_slug ),
|
||||
'delete' => wp_nonce_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug, 'delete-theme_' . $slug ),
|
||||
'activate' => current_user_can( 'switch_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=activate&stylesheet=' . $encoded_slug ), 'switch-theme_' . $slug ) : null,
|
||||
'customize'=> current_user_can( 'edit_theme_options' ) ? admin_url( 'customize.php?theme=' . $encoded_slug ) : null,
|
||||
'delete' => current_user_can( 'delete_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user