Make WordPress Core


Ignore:
Timestamp:
09/10/2013 02:27:24 AM (12 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/template.php

    r25291 r25310  
    257257        // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
    258258        $post = get_queried_object();
    259         $pagename = $post->post_name;
     259        if ( $post )
     260            $pagename = $post->post_name;
    260261    }
    261262
Note: See TracChangeset for help on using the changeset viewer.