Ticket #19798: 19798.patch
File 19798.patch, 2.5 KB (added by , 13 years ago) |
---|
-
wp-includes/post-template.php
1215 1215 function get_the_password_form() { 1216 1216 global $post; 1217 1217 $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID ); 1218 $output = '<form action="' . site_url('wp-pass.php') . '" method="post">1218 $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post"> 1219 1219 <p>' . __("This post is password protected. To view it please enter your password below:") . '</p> 1220 1220 <p><label for="' . $label . '">' . __("Password:") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '" /></p> 1221 1221 </form> -
wp-login.php
339 339 $action = 'resetpass'; 340 340 341 341 // validate action so as to default to the login screen 342 if ( !in_array( $action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login'), true) && false === has_filter('login_form_' . $action) )342 if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) ) 343 343 $action = 'login'; 344 344 345 345 nocache_headers(); … … 367 367 $http_post = ('POST' == $_SERVER['REQUEST_METHOD']); 368 368 switch ($action) { 369 369 370 case 'postpass' : 371 // 10 days 372 setcookie('wp-postpass_' . COOKIEHASH, stripslashes( $_POST['post_password'] ), time() + 864000, COOKIEPATH); 373 374 wp_safe_redirect( wp_get_referer() ); 375 exit(); 376 377 break; 378 370 379 case 'logout' : 371 380 check_admin_referer('log-out'); 372 381 wp_logout(); -
wp-pass.php
1 <?php2 /**3 * Creates the password cookie and redirects back to where the4 * visitor was before.5 *6 * @package WordPress7 */8 9 /** Make sure that the WordPress bootstrap has run before continuing. */10 require( dirname(__FILE__) . '/wp-load.php');11 12 // 10 days13 setcookie('wp-postpass_' . COOKIEHASH, stripslashes( $_POST['post_password'] ), time() + 864000, COOKIEPATH);14 15 wp_safe_redirect(wp_get_referer());16 exit;