Make WordPress Core


Ignore:
Timestamp:
09/10/2013 02:27:24 AM (11 years ago)
Author:
wonderboymusic
Message:

Make sure the queried object is non-null before accessing its properties.

Props markoheijnen, ryan.
Fixes #21394.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r25085 r25310  
    714714 */
    715715function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) {
    716     if ( is_null( $term ) ) {
     716    if ( is_null( $term ) )
    717717        $term = get_queried_object();
    718     }
     718
     719    if ( ! $term )
     720        return;
    719721
    720722    $tax = get_taxonomy( $term->taxonomy );
    721     if ( !current_user_can($tax->cap->edit_terms) )
     723    if ( ! current_user_can( $tax->cap->edit_terms ) )
    722724        return;
    723725
Note: See TracChangeset for help on using the changeset viewer.