Ticket #2123: 404 non existant posts, authors and cats.diff
| File 404 non existant posts, authors and cats.diff, 1.8 KB (added by , 21 years ago) |
|---|
-
classes.php
74 74 75 75 // Parse a query string and set query type booleans. 76 76 function parse_query ($query) { 77 global $wpdb; 77 78 if ( !empty($query) || !isset($this->query) ) { 78 79 $this->init(); 79 80 parse_str($query, $qv); … … 102 103 $this->is_single = true; 103 104 $this->is_attachment = true; 104 105 } elseif ('' != $qv['name']) { 105 $this->is_single = true; 106 if ($qv['name'] == $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '" . $qv['name'] . "' LIMIT 1")) { 107 $this->is_single = true; 108 } 109 else { 110 $this->is_404 = true; 111 $this->is_single = false; 112 } 106 113 } elseif ( $qv['p'] ) { 107 114 $this->is_single = true; 108 115 } elseif (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) { … … 189 196 } 190 197 191 198 if ('' != $qv['category_name']) { 192 $this->is_category = true; 199 if ($qv['category_name'] == $wpdb->get_var("SELECT category_nicename FROM $wpdb->categories WHERE category_nicename = '" . $qv['category_name'] . "' LIMIT 1")) { 200 $this->is_category = true; 201 } 202 else { 203 $this->is_404 = true; 204 $this->is_category = false; 205 } 193 206 } 194 207 195 208 if ((empty($qv['author'])) || ($qv['author'] == '0')) { 196 209 $this->is_author = false; 197 210 } else { 198 $this->is_author = true; 211 if ($qv['author_name'] == $wpdb->get_var("SELECT user_nicename FROM $wpdb->users WHERE user_nicename = '" . $qv['user_nicename'] . "' LIMIT 1")) { 212 $this->is_author = true; 213 } 214 else { 215 $this->is_404 = true; 216 $this->is_author = false; 217 } 199 218 } 200 219 201 220 if ('' != $qv['author_name']) {
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)