Ticket #2734: 2734.diff
| File 2734.diff, 5.5 KB (added by , 20 years ago) |
|---|
-
wp-includes/pluggable-functions.php
229 229 230 230 if ( !function_exists('check_admin_referer') ) : 231 231 function check_admin_referer($action = -1) { 232 global $pagenow ;232 global $pagenow, $menu, $submenu, $parent_file, $submenu_file;; 233 233 $adminurl = strtolower(get_settings('siteurl')).'/wp-admin'; 234 234 $referer = strtolower($_SERVER['HTTP_REFERER']); 235 235 if ( !wp_verify_nonce($_REQUEST['_wpnonce'], $action) && 236 236 !(-1 == $action && strstr($referer, $adminurl)) ) { 237 238 $html = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>\n<html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en'>\n\n";239 $ html .= "<head>\n\t<title>" . __('WordPress Confirmation') . "</title>\n";240 $html .= "</head>\n<body>\n";237 if ( $referer ) 238 $adminurl = $referer; 239 $title = __('WordPress Confirmation'); 240 require_once(ABSPATH . '/wp-admin/admin-header.php'); 241 241 if ( $_POST ) { 242 242 $q = http_build_query($_POST); 243 243 $q = explode( ini_get('arg_separator.output'), $q); … … 248 248 $html .= "\t\t<input type='hidden' name='" . wp_specialchars( urldecode($k), 1 ) . "' value='" . wp_specialchars( urldecode($v), 1 ) . "' />\n"; 249 249 } 250 250 $html .= "\t\t<input type='hidden' name='_wpnonce' value='" . wp_create_nonce($action) . "' />\n"; 251 $html .= "\t\t< p>" . __('Are you sure you want to do this?') . "</p>\n\t\t<p><a href='$adminurl'>No</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t</form>\n";251 $html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>" . __('Are you sure you want to do this?') . "</p>\n\t\t<p><a href='$adminurl'>" . __('No') . "</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t\t</div>\n\t</form>\n"; 252 252 } else { 253 $html .= "\t< p>" . __('Are you sure you want to do this?') . "</p>\n\t\t<p><a href='$adminurl'>No</a> <a href='" . add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] ) . "'>" . __('Yes') . "</a></p>\n";253 $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . __('Are you sure you want to do this?') . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] ) . "'>" . __('Yes') . "</a></p>\n\t</div>\n"; 254 254 } 255 255 $html .= "</body>\n</html>"; 256 257 die($html); 256 echo $html; 257 include_once(ABSPATH . '/wp-admin/admin-footer.php'); 258 die(); 258 259 } 259 260 do_action('check_admin_referer', $action); 260 261 }endif; -
wp-admin/wp-admin.css
361 361 display: none; 362 362 } 363 363 364 .updated {364 .updated, .confirm { 365 365 background: #CFEBF7 url(images/notice.gif) no-repeat 1em ; 366 366 border: 1px solid #2580B2; 367 367 margin: 1em 5% 10px; -
wp-admin/profile-update.php
1 1 <?php 2 2 3 $parent_file = 'profile.php'; 4 $submenu_file = 'profile.php'; 3 5 require_once('admin.php'); 4 6 5 7 check_admin_referer('update-profile' . $user_ID); -
wp-admin/post.php
1 1 <?php 2 2 require_once('admin.php'); 3 3 4 $parent_file = 'edit.php'; 5 $submenu_file = 'edit.php'; 4 6 $wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder' ); 5 7 6 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { … … 24 26 switch($action) { 25 27 case 'postajaxpost': 26 28 case 'post': 29 $parent_file = 'post-new.php'; 30 $submenu_file = 'post-new.php'; 27 31 check_admin_referer('add-post'); 28 32 29 33 $post_ID = 'post' == $action ? write_post() : edit_post(); … … 54 58 55 59 case 'edit': 56 60 $title = __('Edit'); 57 $parent_file = 'edit.php';58 $submenu_file = 'edit.php';59 61 $editing = true; 60 62 require_once('admin-header.php'); 61 63 -
wp-admin/comment.php
1 1 <?php 2 2 require_once('admin.php'); 3 3 4 $parent_file = 'edit.php'; 5 $submenu_file = 'edit-comments.php'; 4 6 $wpvarstoreset = array('action'); 5 7 6 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { … … 24 26 switch($action) { 25 27 case 'editcomment': 26 28 $title = __('Edit Comment'); 27 $parent_file = 'edit.php';28 $submenu_file = 'edit-comments.php';29 29 $editing = true; 30 30 require_once ('admin-header.php'); 31 31 … … 202 202 203 203 include('admin-footer.php'); 204 204 205 ?> 206 No newline at end of file 205 ?> -
wp-admin/page.php
1 1 <?php 2 2 require_once('admin.php'); 3 3 4 $parent_file = 'edit.php'; 5 $submenu_file = 'edit-pages.php'; 4 6 $wpvarstoreset = array('action'); 5 7 6 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { … … 53 55 54 56 case 'edit': 55 57 $title = __('Edit'); 56 $parent_file = 'edit.php';57 $submenu_file = 'edit-pages.php';58 58 $editing = true; 59 59 require_once('admin-header.php'); 60 60