Cookies are now unique, based on siteurl, allowing multiple installs under a single domain name.

git-svn-id: https://develop.svn.wordpress.org/trunk@458 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dougal Campbell
2003-10-20 20:53:13 +00:00
parent 5440f4bde1
commit 620001f33e
11 changed files with 45 additions and 42 deletions

View File

@@ -598,13 +598,13 @@ function the_content_unicode($more_link_text='(more...)', $stripteaser=0, $more_
function get_the_content($more_link_text='(more...)', $stripteaser=0, $more_file='') {
global $id, $post, $more, $c, $withcomments, $page, $pages, $multipage, $numpages;
global $HTTP_SERVER_VARS, $HTTP_COOKIE_VARS, $preview;
global $HTTP_SERVER_VARS, $HTTP_COOKIE_VARS, $preview, $cookiehash;
global $querystring_start, $querystring_equal, $querystring_separator;
global $pagenow;
$output = '';
if (!empty($post->post_password)) { // if there's a password
if ($HTTP_COOKIE_VARS['wp-postpass'] != $post->post_password) { // and it doesn't match the cookie
if ($HTTP_COOKIE_VARS['wp-postpass_'.$cookiehash] != $post->post_password) { // and it doesn't match the cookie
$output = get_the_password_form();
return $output;
}
@@ -692,11 +692,11 @@ function the_excerpt_unicode() {
function get_the_excerpt($fakeit = false) {
global $id, $post;
global $HTTP_SERVER_VARS, $HTTP_COOKIE_VARS, $preview;
global $HTTP_SERVER_VARS, $HTTP_COOKIE_VARS, $preview, $cookiehash;
$output = '';
$output = stripslashes($post->post_excerpt);
if (!empty($post->post_password)) { // if there's a password
if ($HTTP_COOKIE_VARS['wp-postpass'] != $post->post_password) { // and it doesn't match the cookie
if ($HTTP_COOKIE_VARS['wp-postpass_'.$cookiehash] != $post->post_password) { // and it doesn't match the cookie
$output = "There is no excerpt because this is a protected post.";
return $output;
}
@@ -1173,7 +1173,7 @@ function comments_popup_script($width=400, $height=400, $file='b2commentspopup.p
}
function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
global $id, $b2commentspopupfile, $b2commentsjavascript, $post, $wpdb, $tablecomments, $HTTP_COOKIE_VARS;
global $id, $b2commentspopupfile, $b2commentsjavascript, $post, $wpdb, $tablecomments, $HTTP_COOKIE_VARS, $cookiehash;
global $querystring_start, $querystring_equal, $querystring_separator, $siteurl;
$number = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id");
if (0 == $number && 'closed' == $post->comment_status) {
@@ -1181,7 +1181,7 @@ function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Com
return;
} else {
if (!empty($post->post_password)) { // if there's a password
if ($HTTP_COOKIE_VARS['wp-postpass'] != $post->post_password) { // and it doesn't match the cookie
if ($HTTP_COOKIE_VARS['wp-postpass_'.$cookiehash] != $post->post_password) { // and it doesn't match the cookie
echo("Enter your password to view comments");
return;
}