Make WordPress Core

Changeset 25262


Ignore:
Timestamp:
09/05/2013 09:41:48 PM (10 years ago)
Author:
wonderboymusic
Message:

Add check to make sure a valid argument was passed to get_page_uri().

Props Viper007Bond.
Fixes #24491.

File:
1 edited

Legend:

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

    r25245 r25262  
    35983598 *
    35993599 * @param mixed $page Page object or page ID.
    3600  * @return string Page URI.
    3601  */
    3602 function get_page_uri($page) {
     3600 * @return string|false Page URI, false on error.
     3601 */
     3602function get_page_uri( $page ) {
    36033603    $page = get_post( $page );
    36043604
     3605    if ( ! $page )
     3606        return false;
     3607
    36053608    $uri = $page->post_name;
    36063609
    36073610    foreach ( $page->ancestors as $parent ) {
    3608         $uri = get_post( $parent )->post_name . "/" . $uri;
     3611        $uri = get_post( $parent )->post_name . '/' . $uri;
    36093612    }
    36103613
Note: See TracChangeset for help on using the changeset viewer.