WordPress.org

Make WordPress Core

Ticket #6593: 6593_stripslash.diff

File 6593_stripslash.diff, 818 bytes (added by jhodgdon, 6 years ago)

Strips slashes in is_term always (also trims, to fix #9347)

  • wp-includes/taxonomy.php

    ### Eclipse Workspace Patch 1.0
    #P WordPressDev
     
    844844 * 
    845845 * @uses $wpdb 
    846846 * 
    847  * @param int|string $term The term to check 
     847 * @param int|string $term The term to check (assumed not stripslashed) 
    848848 * @param string $taxonomy The taxonomy name to use 
    849849 * @param int $parent ID of parent term under which to confine the exists search. 
    850850 * @return mixed Get the term id or Term Object, if exists. 
     
    865865                        return $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) ); 
    866866        } 
    867867 
     868        $term = trim( stripslashes( $term )); 
     869     
    868870        if ( '' === $slug = sanitize_title($term) ) 
    869871                return 0; 
    870872