summaryrefslogtreecommitdiffstats
path: root/wp-includes/pluggable.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/pluggable.php')
-rw-r--r--wp-includes/pluggable.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index 18426d6..a4bb24b 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -46,7 +46,7 @@ function get_currentuserinfo() {
if ( ! empty($current_user) )
return;
- if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) ||
+ if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) ||
!wp_login($_COOKIE[USER_COOKIE], $_COOKIE[PASS_COOKIE], true) ) {
wp_set_current_user(0);
return false;
@@ -218,7 +218,7 @@ endif;
if ( !function_exists('auth_redirect') ) :
function auth_redirect() {
// Checks if a user is logged in, if not redirects them to the login page
- if ( (!empty($_COOKIE[USER_COOKIE]) &&
+ if ( (!empty($_COOKIE[USER_COOKIE]) &&
!wp_login($_COOKIE[USER_COOKIE], $_COOKIE[PASS_COOKIE], true)) ||
(empty($_COOKIE[USER_COOKIE])) ) {
nocache_headers();
@@ -278,7 +278,8 @@ function wp_redirect($location, $status = 302) {
if ( $is_IIS ) {
header("Refresh: 0;url=$location");
} else {
- status_header($status); // This causes problems on IIS
+ if ( php_sapi_name() != 'cgi-fcgi' )
+ status_header($status); // This causes problems on IIS and some FastCGI setups
header("Location: $location");
}
}
@@ -339,7 +340,7 @@ endif;
if ( ! function_exists('wp_notify_postauthor') ) :
function wp_notify_postauthor($comment_id, $comment_type='') {
global $wpdb;
-
+
$comment = get_comment($comment_id);
$post = get_post($comment->comment_post_ID);
$user = get_userdata( $post->post_author );
@@ -386,11 +387,11 @@ function wp_notify_postauthor($comment_id, $comment_type='') {
$from = "From: \"$blogname\" <$admin_email>";
if ( '' != $comment->comment_author_email )
$reply_to = "Reply-To: $comment->comment_author_email";
- } else {
+ } else {
$from = "From: \"$comment->comment_author\" <$admin_email>";
if ( '' != $comment->comment_author_email )
$reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>";
- }
+ }
$message_headers = "MIME-Version: 1.0\n"
. "$from\n"
@@ -434,9 +435,9 @@ function wp_notify_moderator($comment_id) {
$notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n";
$notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
$notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
- $notify_message .= sprintf( __('To approve this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
- $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
- $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
+ $notify_message .= sprintf( __('Approve it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
+ $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
+ $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
$notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n";
$notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";
@@ -447,7 +448,7 @@ function wp_notify_moderator($comment_id) {
$subject = apply_filters('comment_moderation_subject', $subject, $comment_id);
@wp_mail($admin_email, $subject, $notify_message);
-
+
return true;
}
endif;
@@ -497,7 +498,7 @@ function wp_create_nonce($action = -1) {
$uid = $user->id;
$i = ceil(time() / 43200);
-
+
return substr(wp_hash($i . $action . $uid), -12, 10);
}
endif;