git-svn-id: https://develop.svn.wordpress.org/trunk@1767 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2004-10-10 17:46:50 +00:00
parent c701b9129a
commit 13ed1f3830
1 changed files with 7 additions and 6 deletions

View File

@ -1,11 +1,12 @@
<?php
/*
This is just a very simple script to set a cookie with a posted password and redirect back from whence the browser came.
It doesn't need to connect to the DB, or do anything fancy at all. Yum.
-- Matt
*/
require(dirname(__FILE__) . '/wp-config.php');
setcookie('wp-postpass_'.$cookiehash, stripslashes($_POST['post_password']), time()+60*60*24*30);
if ( get_magic_quotes_gpc() )
$_POST['post_password'] = stripslashes($_POST['post_password']);
// 10 days
setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
header('Location: ' . $_SERVER['HTTP_REFERER']);
?>