Make WordPress Core


Ignore:
Timestamp:
05/01/2020 02:24:42 PM (5 years ago)
Author:
desrosj
Message:

External Libraries: Update the SimplePie library to the latest version (1.5.5).

This brings SimplePie in sync with the most up to date version, 1.5.5.

This update brings many bug fixes, small enhancements, and PHP compatibility fixes for newer versions of PHP.

For a full list of changes, see https://github.com/simplepie/simplepie/blob/master/CHANGELOG.md#155-may-1-2020.

Props dshanske, slushman, etruel, wpshades, dmenard, desrosj, hareesh-pillai, stevenkword, jrf, Ipstenu, johnbillion.
Fixes #36669.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/SimplePie/Cache/MySQL.php

    r22798 r47733  
    66 * Takes the hard work out of managing a complete RSS/Atom solution.
    77 *
    8  * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
     8 * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
    99 * All rights reserved.
    1010 *
     
    3434 *
    3535 * @package SimplePie
    36  * @version 1.3.1
    37  * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
     36 * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
    3837 * @author Ryan Parman
    39  * @author Geoffrey Sneddon
     38 * @author Sam Sneddon
    4039 * @author Ryan McCue
    4140 * @link http://simplepie.org/ SimplePie
     
    9594            'extras' => array(
    9695                'prefix' => '',
     96                'cache_purge_time' => 2592000
    9797            ),
    9898        );
    99         $this->options = array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));
     99
     100        $this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));
    100101
    101102        // Path is prefixed with a "/"
     
    131132            if ($query === false)
    132133            {
     134                trigger_error("Can't create " . $this->options['extras']['prefix'] . "cache_data table, check permissions", E_USER_WARNING);
    133135                $this->mysql = null;
     136                return;
    134137            }
    135138        }
     
    137140        if (!in_array($this->options['extras']['prefix'] . 'items', $db))
    138141        {
    139             $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` TEXT CHARACTER SET utf8 NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))');
     142            $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` MEDIUMBLOB NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))');
    140143            if ($query === false)
    141144            {
     145                trigger_error("Can't create " . $this->options['extras']['prefix'] . "items table, check permissions", E_USER_WARNING);
    142146                $this->mysql = null;
     147                return;
    143148            }
    144149        }
     
    154159    {
    155160        if ($this->mysql === null)
     161        {
     162            return false;
     163        }
     164
     165        $query = $this->mysql->prepare('DELETE i, cd FROM `' . $this->options['extras']['prefix'] . 'cache_data` cd, ' .
     166            '`' . $this->options['extras']['prefix'] . 'items` i ' .
     167            'WHERE cd.id = i.feed_id ' .
     168            'AND cd.mtime < (unix_timestamp() - :purge_time)');
     169        $query->bindValue(':purge_time', $this->options['extras']['cache_purge_time']);
     170
     171        if (!$query->execute())
    156172        {
    157173            return false;
     
    380396            return $time;
    381397        }
    382         else
    383         {
    384             return false;
    385         }
     398
     399        return false;
    386400    }
    387401
     
    401415        $query->bindValue(':time', time());
    402416        $query->bindValue(':id', $this->id);
    403         if ($query->execute() && $query->rowCount() > 0)
    404         {
    405             return true;
    406         }
    407         else
    408         {
    409             return false;
    410         }
     417
     418        return $query->execute() && $query->rowCount() > 0;
    411419    }
    412420
     
    427435        $query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id');
    428436        $query2->bindValue(':id', $this->id);
    429         if ($query->execute() && $query2->execute())
    430         {
    431             return true;
    432         }
    433         else
    434         {
    435             return false;
    436         }
     437
     438        return $query->execute() && $query2->execute();
    437439    }
    438440}
Note: See TracChangeset for help on using the changeset viewer.