From c45449097309030b8eee350bd7b99eee6c4dd294 Mon Sep 17 00:00:00 2001 From: rboren Date: Sun, 16 May 2004 22:07:26 +0000 Subject: [PATCH] Allow underscores in category and author names. git-svn-id: http://svn.automattic.com/wordpress/trunk@1289 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-blog-header.php | 4 ++-- wp-includes/functions-formatting.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/wp-blog-header.php b/wp-blog-header.php index fd975cdbc..3304ca142 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -275,7 +275,7 @@ if ('' != $category_name) { $category_name = $category_name[count($category_name)-2]; // there was a trailling slash } } - $category_name = preg_replace('|[^a-z0-9-]|i', '', $category_name); + $category_name = preg_replace('|[^a-z0-9-_]|i', '', $category_name); $tables = ", $tablepost2cat, $tablecategories"; $join = " LEFT JOIN $tablepost2cat ON ($tableposts.ID = $tablepost2cat.post_id) LEFT JOIN $tablecategories ON ($tablepost2cat.category_id = $tablecategories.cat_ID) "; $whichcat = " AND (category_nicename = '$category_name'"; @@ -323,7 +323,7 @@ if ('' != $author_name) { $author_name = $author_name[count($author_name)-2];#there was a trailling slash } } - $author_name = preg_replace('|[^a-z0-9-]|', '', strtolower($author_name)); + $author_name = preg_replace('|[^a-z0-9-_]|', '', strtolower($author_name)); $author = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_nicename='".$author_name."'"); $whichauthor .= ' AND (post_author = '.intval($author).')'; } diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 9237feba4..21f70b5b4 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -1,5 +1,7 @@