]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-pass.php
Wordpress 3.3.1-scripts
[autoinstalls/wordpress.git] / wp-pass.php
index e1cb4e055e1ac0d6e4fa8dee945e66fd14f845bd..556deab9c64cfb4e694fbd349b1aa65e383ba7c0 100644 (file)
@@ -1,11 +1,17 @@
 <?php
-require( dirname(__FILE__) . '/wp-config.php');
+/**
+ * Creates the password cookie and redirects back to where the
+ * visitor was before.
+ *
+ * @package WordPress
+ */
 
-if ( get_magic_quotes_gpc() )
-       $_POST['post_password'] = stripslashes($_POST['post_password']);
+/** Make sure that the WordPress bootstrap has run before continuing. */
+require( dirname(__FILE__) . '/wp-load.php');
 
 // 10 days
-setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
+setcookie('wp-postpass_' . COOKIEHASH, stripslashes( $_POST['post_password'] ), time() + 864000, COOKIEPATH);
 
-wp_redirect(wp_get_referer());
-?>
\ No newline at end of file
+wp_safe_redirect(wp_get_referer());
+exit;
+?>