Changeset 1533 for trunk/wp-includes/classes.php
- Timestamp:
- 08/14/2004 04:08:57 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/classes.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r1531 r1533 219 219 220 220 if ('' != $q['name']) { 221 $q['name'] = preg_replace('/[^a-z0-9-_]/', '',$q['name']);221 $q['name'] = sanitize_title($q['name']); 222 222 $where .= " AND post_name = '" . $q['name'] . "'"; 223 223 } else if ('' != $q['pagename']) { 224 224 // If pagename is set, set static to true and set name to pagename. 225 $q['pagename'] = preg_replace('/[^a-z0-9-_]/', '',$q['pagename']);225 $q['pagename'] = sanitize_title($q['pagename']); 226 226 $q['name'] = $q['pagename']; 227 227 $q['static'] = true; … … 317 317 } 318 318 } 319 $q['category_name'] = preg_replace('|[^a-z0-9-_]|i', '',$q['category_name']);319 $q['category_name'] = sanitize_title($q['category_name']); 320 320 $tables = ", $wpdb->post2cat, $wpdb->categories"; 321 321 $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) "; … … 361 361 } 362 362 } 363 $q['author_name'] = preg_replace('|[^a-z0-9-_]|', '', strtolower($q['author_name']));363 $q['author_name'] = sanitize_title($q['author_name']); 364 364 $q['author'] = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_nicename='".$q['author_name']."'"); 365 365 $whichauthor .= ' AND (post_author = '.intval($q['author']).')';
Note: See TracChangeset
for help on using the changeset viewer.