Ticket #14748: 14748.diff
| File 14748.diff, 1.8 KB (added by dd32, 2 years ago) |
|---|
-
wp-includes/post-template.php
555 555 if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) ) 556 556 return true; 557 557 558 if ( $_COOKIE['wp-postpass_' . COOKIEHASH]!= $post->post_password )558 if ( stripslashes($_COOKIE['wp-postpass_' . COOKIEHASH]) != $post->post_password ) 559 559 return true; 560 560 561 561 return false; … … 1206 1206 */ 1207 1207 function get_the_password_form() { 1208 1208 global $post; 1209 $label = 'pwbox-' .(empty($post->ID) ? rand() : $post->ID);1210 $output = '<form action="' . get_option('siteurl') . '/wp-pass.php" method="post">1209 $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID ); 1210 $output = '<form action="' . site_url('wp-pass.php') . '" method="post"> 1211 1211 <p>' . __("This post is password protected. To view it please enter your password below:") . '</p> 1212 1212 <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> 1213 1213 </form> -
wp-pass.php
9 9 /** Make sure that the WordPress bootstrap has run before continuing. */ 10 10 require( dirname(__FILE__) . '/wp-load.php'); 11 11 12 if ( get_magic_quotes_gpc() )13 $_POST['post_password'] = stripslashes($_POST['post_password']);14 15 12 // 10 days 16 setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);13 setcookie('wp-postpass_' . COOKIEHASH, stripslashes($_POST['post_password']), time() + 864000, COOKIEPATH); 17 14 18 15 wp_safe_redirect(wp_get_referer()); 19 16 exit;
