From e715ba1cd004f15d443ba5c8f48f12ca3fb7bcb6 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 19 Dec 2007 17:45:50 +0000 Subject: [PATCH] Allows 0 titles when sanitizing. Props mdawaffe. fixes #5293 git-svn-id: https://develop.svn.wordpress.org/trunk@6409 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 3 +-- wp-includes/taxonomy.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index a9235210f7..e8c85832d3 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -329,9 +329,8 @@ function sanitize_title($title, $fallback_title = '') { $title = strip_tags($title); $title = apply_filters('sanitize_title', $title); - if (empty($title)) { + if ( '' === $title || false === $title ) $title = $fallback_title; - } return $title; } diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 7179c60d57..6131f6fba0 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -707,7 +707,7 @@ function is_term($term, $taxonomy = '') { return 0; $where = $wpdb->prepare( "t.term_id = %d", $term ); } else { - if ( ! $term = sanitize_title($term) ) + if ( '' === $term = sanitize_title($term) ) return 0; $where = $wpdb->prepare( "t.slug = %s", $term ); }