WordPress.org

Make WordPress Core

Changeset 35509


Ignore:
Timestamp:
11/04/2015 06:07:45 PM (3 years ago)
Author:
wonderboymusic
Message:

XMLRPC: ensure that empty strings are not passed as null, which will then fail isset()

Props solarissmoke.
Fixes #16980.

File:
1 edited

Legend:

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

    r35364 r35509  
    202202    var $_currentTag;
    203203    var $_currentTagContents;
     204    var $_valueHasType = false;
    204205    // The XML parser
    205206    var $_parser;
     
    325326                $this->_arraystructs[] = array();
    326327                break;
     328            case 'value':
     329                $this->_valueHasType = false;
    327330        }
    328331    }
     
    356359            case 'value':
    357360                // "If no type is indicated, the type is string."
    358                 if (trim($this->_currentTagContents) != '') {
    359                     $value = (string)$this->_currentTagContents;
     361                if ( !$this->_valueHasType ) {
     362                    $value = trim( $this->_currentTagContents );
    360363                    $valueFlag = true;
    361364                }
     
    388391
    389392        if ($valueFlag) {
     393            $this->_valueHasType = true;
     394               
    390395            if (count($this->_arraystructs) > 0) {
    391396                // Add value to struct or array
Note: See TracChangeset for help on using the changeset viewer.