Death to trailing tabs. Props Mark J. fixes #2405

git-svn-id: https://develop.svn.wordpress.org/trunk@3517 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-02-12 07:53:23 +00:00
parent 48dc264515
commit 6008a133c4
88 changed files with 1019 additions and 1019 deletions

View File

@@ -53,7 +53,7 @@ class WP_Query {
$this->is_admin = false;
$this->is_attachment = false;
}
function init () {
unset($this->posts);
unset($this->query);
@@ -63,7 +63,7 @@ class WP_Query {
$this->post_count = 0;
$this->current_post = -1;
$this->in_the_loop = false;
$this->init_query_flags();
}
@@ -97,7 +97,7 @@ class WP_Query {
$qv['attachment'] = $qv['subpost'];
if ( '' != $qv['subpost_id'] )
$qv['attachment_id'] = $qv['subpost_id'];
if ( ('' != $qv['attachment']) || (int) $qv['attachment_id'] ) {
$this->is_single = true;
$this->is_attachment = true;
@@ -226,7 +226,7 @@ class WP_Query {
if ('' != $qv['comments_popup']) {
$this->is_comments_popup = true;
}
//if we're previewing inside the write screen
if ('' != $qv['preview']) {
$this->is_preview = true;
@@ -247,9 +247,9 @@ class WP_Query {
function set_404() {
$this->init_query_flags();
$this->is_404 = true;
$this->is_404 = true;
}
function get($query_var) {
if (isset($this->query_vars[$query_var])) {
return $this->query_vars[$query_var];
@@ -268,7 +268,7 @@ class WP_Query {
do_action('pre_get_posts', array(&$this));
// Shorthand.
$q = $this->query_vars;
$q = $this->query_vars;
// First let's clear some variables
$whichcat = '';
@@ -306,7 +306,7 @@ class WP_Query {
$q['page'] = trim($q['page'], '/');
$q['page'] = (int) $q['page'];
}
$add_hours = intval(get_settings('gmt_offset'));
$add_minutes = intval(60 * (get_settings('gmt_offset') - $add_hours));
$wp_posts_post_date_field = "post_date"; // "DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)";
@@ -372,7 +372,7 @@ class WP_Query {
$page_paths = '/' . trim($q['pagename'], '/');
$q['pagename'] = sanitize_title(basename($page_paths));
$q['name'] = $q['pagename'];
$where .= " AND (ID = '$reqpage')";
} elseif ('' != $q['attachment']) {
$q['attachment'] = str_replace('%2F', '/', urlencode(urldecode($q['attachment'])));
@@ -489,11 +489,11 @@ class WP_Query {
$partial_match = $cat_id;
}
}
//if we don't match the entire hierarchy fallback on just matching the nicename
if (!$q['cat'] && $partial_match) {
$q['cat'] = $partial_match;
}
}
$tables = ", $wpdb->post2cat, $wpdb->categories";
$join = " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) LEFT JOIN $wpdb->categories ON ($wpdb->post2cat.category_id = $wpdb->categories.cat_ID) ";
@@ -541,7 +541,7 @@ class WP_Query {
$q['author'] = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_nicename='".$q['author_name']."'");
$whichauthor .= ' AND (post_author = '.intval($q['author']).')';
}
$where .= $search.$whichcat.$whichauthor;
if ((empty($q['order'])) || ((strtoupper($q['order']) != 'ASC') && (strtoupper($q['order']) != 'DESC'))) {
@@ -597,7 +597,7 @@ class WP_Query {
if ( is_user_logged_in() )
$where .= " OR post_author = $user_ID AND post_status = 'private')";
else
$where .= ')';
$where .= ')';
}
// Apply filters on where and join prior to paging so that any
@@ -680,7 +680,7 @@ class WP_Query {
if ($this->post_count > 0) {
$this->post = $this->posts[0];
}
// Save any changes made to the query vars.
$this->query_vars = $q;
return $this->posts;
@@ -841,7 +841,7 @@ class retrospam_mgr {
$head = '<div class="wrap"><h2>' . __('Check Comments Results:') . '</h2>';
$foot .= '<p><a href="options-discussion.php">' . __('&laquo; Return to Discussion Options page.') . '</a></p></div>';
return $head . $body . $foot;
} // End function display_edit_form
@@ -922,7 +922,7 @@ class WP_Rewrite {
return false;
else
return true;
}
}
function using_index_permalinks() {
if (empty($this->permalink_structure)) {
@@ -942,7 +942,7 @@ class WP_Rewrite {
return true;
else
return false;
}
}
function preg_index($number) {
$match_prefix = '$';
@@ -987,7 +987,7 @@ class WP_Rewrite {
$this->date_structure = '';
return false;
}
// The date permalink must have year, month, and day separated by slashes.
$endians = array('%year%/%monthnum%/%day%', '%day%/%monthnum%/%year%', '%monthnum%/%day%/%year%');
@@ -1070,7 +1070,7 @@ class WP_Rewrite {
$this->category_structure = $this->category_base . '/';
$this->category_structure .= '%category%';
return $this->category_structure;
}
@@ -1153,10 +1153,10 @@ class WP_Rewrite {
// If the tag already exists, replace the existing pattern and query for
// that tag, otherwise add the new tag, pattern, and query to the end of
// the arrays.
$position = array_search($tag, $this->rewritecode);
$position = array_search($tag, $this->rewritecode);
if (FALSE !== $position && NULL !== $position) {
$this->rewritereplace[$position] = $pattern;
$this->queryreplace[$position] = $query;
$this->queryreplace[$position] = $query;
} else {
$this->rewritecode[] = $tag;
$this->rewritereplace[] = $pattern;
@@ -1174,7 +1174,7 @@ class WP_Rewrite {
$trackbackregex = 'trackback/?$';
$pageregex = 'page/?([0-9]{1,})/?$';
$front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
preg_match_all('/%.+?%/', $permalink_structure, $tokens);
@@ -1304,7 +1304,7 @@ class WP_Rewrite {
// Date
$date_rewrite = $this->generate_rewrite_rules($this->get_date_permastruct());
$date_rewrite = apply_filters('date_rewrite_rules', $date_rewrite);
// Root
$root_rewrite = $this->generate_rewrite_rules($this->root . '/');
$root_rewrite = apply_filters('root_rewrite_rules', $root_rewrite);
@@ -1372,7 +1372,7 @@ class WP_Rewrite {
$rules .= "RewriteCond %{REQUEST_FILENAME} -f [OR]\n" .
"RewriteCond %{REQUEST_FILENAME} -d\n" .
"RewriteRule ^.*$ - [S=$num_rules]\n";
foreach ($rewrite as $match => $query) {
// Apache 1.3 does not support the reluctant (non-greedy) modifier.
$match = str_replace('.+?', '.+', $match);
@@ -1382,7 +1382,7 @@ class WP_Rewrite {
if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) {
//nada.
}
if (strstr($query, $this->index)) {
$rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n";
} else {
@@ -1413,7 +1413,7 @@ class WP_Rewrite {
function init() {
$this->permalink_structure = get_settings('permalink_structure');
$this->front = substr($this->permalink_structure, 0, strpos($this->permalink_structure, '%'));
$this->front = substr($this->permalink_structure, 0, strpos($this->permalink_structure, '%'));
$this->root = '';
if ($this->using_index_permalinks()) {
$this->root = $this->index . '/';
@@ -1493,7 +1493,7 @@ class WP {
// Trim path info from the end and the leading home path from the
// front. For path info requests, this leaves us with the requesting
// filename, if any. For 404 requests, this leaves us with the
// requested permalink.
// requested permalink.
$req_uri = str_replace($pathinfo, '', $req_uri);
$req_uri = trim($req_uri, '/');
$req_uri = preg_replace("|^$home_path|", '', $req_uri);
@@ -1562,10 +1562,10 @@ class WP {
if (isset($error))
unset($error);
if ( isset($query_vars) && strstr($_SERVER['PHP_SELF'], 'wp-admin/') )
unset($query_vars);
$this->did_permalink = false;
}
}
@@ -1619,7 +1619,7 @@ class WP {
// If string is empty, return 0. If not, attempt to parse into a timestamp
$client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0;
// Make a timestamp for our most recent modification...
// Make a timestamp for our most recent modification...
$wp_modified_timestamp = strtotime($wp_last_modified);
if ( ($client_last_modified && $client_etag) ?