Make WordPress Core


Ignore:
Timestamp:
09/30/2024 10:48:16 PM (8 months ago)
Author:
SergeyBiryukov
Message:

External Libraries: Update the SimplePie library to version 1.8.0.

The most notable change in this update is that all code is now namespaced and uses PSR-4 classes, though there is a compatibility layer available for extenders using the older class names, so plugin or theme authors directly using SimplePie can decide for themselves when they want to change to using the namespaced names for SimplePie classes.

Note: This commit includes additional fixes for PHP 8.4 compatibility (PR 875, PR 888) from the one-dot-eight branch of SimplePie, which is expected to be released as SimplePie 1.8.1 soon.

References:

Follow-up to [47733], [49176], [52393], [52413].

Props jrf, peterwilsoncc, chaion07, cu121, markparnell, audrasjb, costdev, Presskopp, desrosj, faisal03, mukesh27, SergeyBiryukov.
See #55604.

Location:
trunk/src/wp-includes/SimplePie/src
Files:
1 added
1 moved

Legend:

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

    r59140 r59141  
    11<?php
     2
    23/**
    34 * SimplePie
     
    67 * Takes the hard work out of managing a complete RSS/Atom solution.
    78 *
    8  * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
     9 * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
    910 * All rights reserved.
    1011 *
     
    4243 */
    4344
     45namespace SimplePie;
     46
    4447/**
    4548 * Handles `<media:restriction>` as defined in Media RSS
    4649 *
    47  * Used by {@see SimplePie_Enclosure::get_restriction()} and {@see SimplePie_Enclosure::get_restrictions()}
     50 * Used by {@see \SimplePie\Enclosure::get_restriction()} and {@see \SimplePie\Enclosure::get_restrictions()}
    4851 *
    49  * This class can be overloaded with {@see SimplePie::set_restriction_class()}
     52 * This class can be overloaded with {@see \SimplePie\SimplePie::set_restriction_class()}
    5053 *
    5154 * @package SimplePie
    5255 * @subpackage API
    5356 */
    54 class SimplePie_Restriction
     57class Restriction
    5558{
    56     /**
    57     * Relationship ('allow'/'deny')
    58     *
    59     * @var string
    60     * @see get_relationship()
    61     */
    62     var $relationship;
     59    /**
     60    * Relationship ('allow'/'deny')
     61    *
     62    * @var string
     63    * @see get_relationship()
     64    */
     65    public $relationship;
    6366
    64     /**
    65     * Type of restriction
    66     *
    67     * @var string
    68     * @see get_type()
    69     */
    70     var $type;
     67    /**
     68    * Type of restriction
     69    *
     70    * @var string
     71    * @see get_type()
     72    */
     73    public $type;
    7174
    72     /**
    73     * Restricted values
    74     *
    75     * @var string
    76     * @see get_value()
    77     */
    78     var $value;
     75    /**
     76    * Restricted values
     77    *
     78    * @var string
     79    * @see get_value()
     80    */
     81    public $value;
    7982
    80     /**
    81     * Constructor, used to input the data
    82     *
    83     * For documentation on all the parameters, see the corresponding
    84     * properties and their accessors
    85     */
    86     public function __construct($relationship = null, $type = null, $value = null)
    87     {
    88         $this->relationship = $relationship;
    89         $this->type = $type;
    90         $this->value = $value;
    91     }
     83    /**
     84    * Constructor, used to input the data
     85    *
     86    * For documentation on all the parameters, see the corresponding
     87    * properties and their accessors
     88    */
     89    public function __construct($relationship = null, $type = null, $value = null)
     90    {
     91        $this->relationship = $relationship;
     92        $this->type = $type;
     93        $this->value = $value;
     94    }
    9295
    93     /**
    94     * String-ified version
    95     *
    96     * @return string
    97     */
    98     public function __toString()
    99     {
    100         // There is no $this->data here
    101         return md5(serialize($this));
    102     }
     96    /**
     97    * String-ified version
     98    *
     99    * @return string
     100    */
     101    public function __toString()
     102    {
     103        // There is no $this->data here
     104        return md5(serialize($this));
     105    }
    103106
    104     /**
    105      * Get the relationship
    106      *
    107      * @return string|null Either 'allow' or 'deny'
    108      */
    109     public function get_relationship()
    110     {
    111         if ($this->relationship !== null)
    112         {
    113             return $this->relationship;
    114         }
     107    /**
     108     * Get the relationship
     109     *
     110     * @return string|null Either 'allow' or 'deny'
     111     */
     112    public function get_relationship()
     113    {
     114        if ($this->relationship !== null) {
     115            return $this->relationship;
     116        }
    115117
    116         return null;
    117     }
     118        return null;
     119    }
    118120
    119     /**
    120      * Get the type
    121      *
    122      * @return string|null
    123      */
    124     public function get_type()
    125     {
    126         if ($this->type !== null)
    127         {
    128             return $this->type;
    129         }
     121    /**
     122     * Get the type
     123     *
     124     * @return string|null
     125     */
     126    public function get_type()
     127    {
     128        if ($this->type !== null) {
     129            return $this->type;
     130        }
    130131
    131         return null;
    132     }
     132        return null;
     133    }
    133134
    134     /**
    135      * Get the list of restricted things
    136      *
    137      * @return string|null
    138      */
    139     public function get_value()
    140     {
    141         if ($this->value !== null)
    142         {
    143             return $this->value;
    144         }
     135    /**
     136     * Get the list of restricted things
     137     *
     138     * @return string|null
     139     */
     140    public function get_value()
     141    {
     142        if ($this->value !== null) {
     143            return $this->value;
     144        }
    145145
    146         return null;
    147     }
     146        return null;
     147    }
    148148}
     149
     150class_alias('SimplePie\Restriction', 'SimplePie_Restriction');
Note: See TracChangeset for help on using the changeset viewer.