Make WordPress Core


Ignore:
Timestamp:
10/14/2019 06:44:54 PM (7 years ago)
Author:
whyisjake
Message:

Backporting several bug fixes.

  • Query: Remove the static query property.
  • HTTP API: Protect against hex interpretation.
  • Filesystem API: Prevent directory travelersals when creating new folders.
  • Administration: Ensure that admin referer nonce is valid.
  • REST API: Send a Vary: Origin header on GET requests.

Backports [46474], [46475], [46476], [46477], [46478], [46483], [46485] to the 4.8 branch.

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

  • branches/4.8/src/wp-includes/class-wp-query.php

    r40103 r46494  
    583583            , 'attachment_id'
    584584            , 'name'
    585             , 'static'
    586585            , 'pagename'
    587586            , 'page_id'
     
    814813            // post is being queried.
    815814            $this->is_single = true;
    816         } elseif ( '' != $qv['static'] || '' != $qv['pagename'] || !empty($qv['page_id']) ) {
     815        } elseif ( '' != $qv['pagename'] || !empty($qv['page_id']) ) {
    817816            $this->is_page = true;
    818817            $this->is_single = false;
     
    30593058            $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
    30603059        } else {
    3061             $this->found_posts = count( $this->posts );
     3060            if ( is_array( $this->posts ) ) {
     3061                $this->found_posts = count( $this->posts );
     3062            } else {
     3063                if ( null === $this->posts ) {
     3064                    $this->found_posts = 0;
     3065                } else {
     3066                    $this->found_posts = 1;
     3067                }
     3068            }
    30623069        }
    30633070
Note: See TracChangeset for help on using the changeset viewer.