Changeset 1767

Show
Ignore:
Timestamp:
10/10/04 17:46:50 (4 years ago)
Author:
saxmatt
Message:

Cookie path fix: http://wordpress.org/support/3/14408

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-pass.php

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