From ad6fac44d4c2c9f695cc094894effe968a3e3c4f Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 19 Sep 2011 04:17:26 +0000 Subject: [PATCH] Allow Apostrophes in Post Passwords. $_POST and $_COOKIE are always slashed. Fixes #17145 git-svn-id: https://develop.svn.wordpress.org/trunk@18712 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-template.php | 2 +- wp-pass.php | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index a19691bef9..3b6d0c0db4 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -564,7 +564,7 @@ function post_password_required( $post = null ) { if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) ) return true; - if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) + if ( stripslashes( $_COOKIE['wp-postpass_' . COOKIEHASH] ) != $post->post_password ) return true; return false; diff --git a/wp-pass.php b/wp-pass.php index c0c0c42a3e..556deab9c6 100644 --- a/wp-pass.php +++ b/wp-pass.php @@ -9,11 +9,8 @@ /** Make sure that the WordPress bootstrap has run before continuing. */ require( dirname(__FILE__) . '/wp-load.php'); -if ( get_magic_quotes_gpc() ) - $_POST['post_password'] = stripslashes($_POST['post_password']); - // 10 days -setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH); +setcookie('wp-postpass_' . COOKIEHASH, stripslashes( $_POST['post_password'] ), time() + 864000, COOKIEPATH); wp_safe_redirect(wp_get_referer()); exit;