Make WordPress Core


Ignore:
Timestamp:
05/16/2004 10:07:26 PM (22 years ago)
Author:
rboren
Message:

Allow underscores in category and author names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-blog-header.php

    r1281 r1289  
    276276        }
    277277    }
    278     $category_name = preg_replace('|[^a-z0-9-]|i', '', $category_name);
     278    $category_name = preg_replace('|[^a-z0-9-_]|i', '', $category_name);
    279279    $tables = ", $tablepost2cat, $tablecategories";
    280280    $join = " LEFT JOIN $tablepost2cat ON ($tableposts.ID = $tablepost2cat.post_id) LEFT JOIN $tablecategories ON ($tablepost2cat.category_id = $tablecategories.cat_ID) ";
     
    324324        }
    325325    }
    326     $author_name = preg_replace('|[^a-z0-9-]|', '', strtolower($author_name));
     326    $author_name = preg_replace('|[^a-z0-9-_]|', '', strtolower($author_name));
    327327    $author = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_nicename='".$author_name."'");
    328328    $whichauthor .= ' AND (post_author = '.intval($author).')';
Note: See TracChangeset for help on using the changeset viewer.