Ticket #11184: 11184-merged-for-2.9.patch
| File 11184-merged-for-2.9.patch, 7.2 KB (added by nacin, 3 years ago) |
|---|
-
wp-admin/plugins.php
64 64 65 65 check_admin_referer('bulk-manage-plugins'); 66 66 67 $plugins = (array) $_POST['checked'];67 $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); 68 68 $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Only activate plugins which are not already active. 69 69 if ( empty($plugins) ) { 70 70 wp_redirect("plugins.php?plugin_status=$status&paged=$page"); … … 115 115 116 116 check_admin_referer('bulk-manage-plugins'); 117 117 118 $plugins = (array) $_POST['checked'];118 $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); 119 119 $plugins = array_filter($plugins, 'is_plugin_active'); //Do not deactivate plugins which are already deactivated. 120 120 if ( empty($plugins) ) { 121 121 wp_redirect("plugins.php?plugin_status=$status&paged=$page"); … … 137 137 wp_die(__('You do not have sufficient permissions to delete plugins for this blog.')); 138 138 139 139 check_admin_referer('bulk-manage-plugins'); 140 141 $plugins = (array) $_REQUEST['checked']; //$_POST = from the plugin form; $_GET = from the FTP details screen. 140 141 //$_POST = from the plugin form; $_GET = from the FTP details screen. 142 $plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array(); 142 143 $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Do not allow to delete Activated plugins. 143 144 if ( empty($plugins) ) { 144 145 wp_redirect("plugins.php?plugin_status=$status&paged=$page"); -
wp-admin/categories.php
34 34 break; 35 35 36 36 case 'delete': 37 if ( !isset( $_GET['cat_ID'] ) ) 38 wp_redirect('categories.php?message=7'); 39 37 40 $cat_ID = (int) $_GET['cat_ID']; 38 41 check_admin_referer('delete-category_' . $cat_ID); 39 42 … … 59 62 if ( !current_user_can('manage_categories') ) 60 63 wp_die( __('You are not allowed to delete categories.') ); 61 64 62 foreach ( (array) $_GET['delete'] as $cat_ID ) { 65 $cats = $_GET['delete']; 66 foreach ( (array) $cats as $cat_ID ) { 63 67 $cat_name = get_cat_name($cat_ID); 64 68 65 69 // Don't delete the default cats. … … 69 73 wp_delete_category($cat_ID); 70 74 } 71 75 72 wp_safe_redirect( wp_get_referer() ); 76 if ( count( (array) $cats ) == 1 ) 77 wp_safe_redirect( add_query_arg( 'message', 2, wp_get_referer() ) ); 78 else 79 wp_safe_redirect( add_query_arg( 'message', 6, wp_get_referer() ) ); 73 80 exit(); 74 81 75 82 break; … … 125 132 $messages[3] = __('Category updated.'); 126 133 $messages[4] = __('Category not added.'); 127 134 $messages[5] = __('Category not updated.'); 135 $messages[6] = __('Categories deleted.'); 136 $messages[7] = __('No categories selected.'); 128 137 ?> 129 138 130 139 <div class="wrap nosubsub"> -
wp-admin/edit-tags.php
44 44 break; 45 45 46 46 case 'delete': 47 if ( !isset( $_GET['tag_ID'] ) ) 48 wp_redirect('edit-tags.php?message=7'); 49 47 50 $tag_ID = (int) $_GET['tag_ID']; 48 51 check_admin_referer('delete-tag_' . $tag_ID); 49 52 … … 81 84 $location = $referer; 82 85 } 83 86 84 $location = add_query_arg('message', 6, $location); 87 if ( count( (array) $tags ) == 1 ) 88 $location = add_query_arg('message', 2, $location); 89 else 90 $location = add_query_arg('message', 6, $location); 85 91 wp_redirect($location); 86 92 exit; 87 93 … … 142 148 $messages[3] = __('Tag updated.'); 143 149 $messages[4] = __('Tag not added.'); 144 150 $messages[5] = __('Tag not updated.'); 145 $messages[6] = __('Tags deleted.'); ?> 151 $messages[6] = __('Tags deleted.'); 152 $messages[7] = __('No tags selected.'); ?> 146 153 147 154 <div class="wrap nosubsub"> 148 155 <?php screen_icon(); ?> -
wp-admin/link-manager.php
18 18 wp_die( __('You do not have sufficient permissions to edit the links for this blog.') ); 19 19 20 20 if ( 'delete' == $doaction ) { 21 foreach ( (array) $_GET['linkcheck'] as $link_id ) { 21 $bulklinks = $_GET['linkcheck']; 22 foreach ( (array) $bulklinks as $link_id ) { 22 23 $link_id = (int) $link_id; 23 24 24 25 wp_delete_link($link_id); 25 26 } 26 27 27 wp_redirect( wp_get_referer() );28 wp_redirect( add_query_arg( 'deleted', count( (array) $bulklinks ), wp_get_referer() ) ); 28 29 exit; 29 30 } 30 31 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { -
wp-admin/edit-link-categories.php
18 18 wp_die(__('Cheatin’ uh?')); 19 19 20 20 if ( 'delete' == $doaction ) { 21 foreach( (array) $_GET['delete'] as $cat_ID ) { 21 $cats = $_GET['delete']; 22 foreach( (array) $cats as $cat_ID ) { 22 23 $cat_name = get_term_field('name', $cat_ID, 'link_category'); 23 24 $default_cat_id = get_option('default_link_category'); 24 25 … … 35 36 $location = $referer; 36 37 } 37 38 38 $location = add_query_arg('message', 6, $location); 39 if ( count( (array) $cats ) == 1 ) 40 $location = add_query_arg( 'message', 2, $location ); 41 else 42 $location = add_query_arg( 'message', 6, $location ); 39 43 wp_redirect($location); 40 44 exit(); 41 45 } 42 46 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { 43 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );47 wp_redirect( add_query_arg( 'message', 7, remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ) ); 44 48 exit; 45 49 } 46 50 … … 57 61 $messages[3] = __('Category updated.'); 58 62 $messages[4] = __('Category not added.'); 59 63 $messages[5] = __('Category not updated.'); 60 $messages[6] = __('Categories deleted.'); ?> 64 $messages[6] = __('Categories deleted.'); 65 $messages[7] = __('No categories selected.'); ?> 61 66 62 67 <div class="wrap nosubsub"> 63 68 <?php screen_icon(); ?> -
wp-admin/js/inline-edit-post.dev.js
74 74 }, 75 75 76 76 setBulk : function() { 77 var te = '', type = this.type, tax ;77 var te = '', type = this.type, tax, c = 0; 78 78 this.revert(); 79 79 80 80 $('#bulk-edit td').attr('colspan', $('.widefat:first thead th:visible').length); … … 83 83 84 84 $('tbody th.check-column input[type="checkbox"]').each(function(i){ 85 85 if ( $(this).attr('checked') ) { 86 c++; 86 87 var id = $(this).val(), theTitle; 87 88 theTitle = $('#inline_'+id+' .post_title').text() || inlineEditL10n.notitle; 88 89 te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+theTitle+'</div>'; 89 90 } 90 91 }); 91 92 93 if (c == 0) 94 this.revert(); 95 92 96 $('#bulk-titles').html(te); 93 97 $('#bulk-titles a').click(function() { 94 98 var id = $(this).attr('id').substr(1);
