Sanitize "cat" query var and cast to int before looking for a category template

git-svn-id: https://develop.svn.wordpress.org/trunk@7586 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2008-04-02 13:15:21 +00:00
parent 4196a8a505
commit 15490b8df5
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -363,8 +363,8 @@ function get_author_template() {
function get_category_template() {
$template = '';
if ( file_exists(TEMPLATEPATH . "/category-" . get_query_var('cat') . '.php') )
$template = TEMPLATEPATH . "/category-" . get_query_var('cat') . '.php';
if ( file_exists(TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php') )
$template = TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php';
elseif ( file_exists(TEMPLATEPATH . "/category.php") )
$template = TEMPLATEPATH . "/category.php";