Make WordPress Core


Ignore:
Timestamp:
09/30/2024 10:48:16 PM (4 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/Author.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 * Manages all author-related data
    4649 *
    47  * Used by {@see SimplePie_Item::get_author()} and {@see SimplePie::get_authors()}
     50 * Used by {@see Item::get_author()} and {@see SimplePie::get_authors()}
    4851 *
    4952 * This class can be overloaded with {@see SimplePie::set_author_class()}
     
    5255 * @subpackage API
    5356 */
    54 class SimplePie_Author
     57class Author
    5558{
    56     /**
    57     * Author's name
    58     *
    59     * @var string
    60     * @see get_name()
    61     */
    62     var $name;
     59    /**
     60    * Author's name
     61    *
     62    * @var string
     63    * @see get_name()
     64    */
     65    public $name;
    6366
    64     /**
    65     * Author's link
    66     *
    67     * @var string
    68     * @see get_link()
    69     */
    70     var $link;
     67    /**
     68    * Author's link
     69    *
     70    * @var string
     71    * @see get_link()
     72    */
     73    public $link;
    7174
    72     /**
    73     * Author's email address
    74     *
    75     * @var string
    76     * @see get_email()
    77     */
    78     var $email;
     75    /**
     76    * Author's email address
     77    *
     78    * @var string
     79    * @see get_email()
     80    */
     81    public $email;
    7982
    80     /**
    81     * Constructor, used to input the data
    82     *
    83     * @param string $name
    84     * @param string $link
    85     * @param string $email
    86     */
    87     public function __construct($name = null, $link = null, $email = null)
    88     {
    89         $this->name = $name;
    90         $this->link = $link;
    91         $this->email = $email;
    92     }
     83    /**
     84    * Constructor, used to input the data
     85    *
     86    * @param string $name
     87    * @param string $link
     88    * @param string $email
     89    */
     90    public function __construct($name = null, $link = null, $email = null)
     91    {
     92        $this->name = $name;
     93        $this->link = $link;
     94        $this->email = $email;
     95    }
    9396
    94     /**
    95     * String-ified version
    96     *
    97     * @return string
    98     */
    99     public function __toString()
    100     {
    101         // There is no $this->data here
    102         return md5(serialize($this));
    103     }
     97    /**
     98    * String-ified version
     99    *
     100    * @return string
     101    */
     102    public function __toString()
     103    {
     104        // There is no $this->data here
     105        return md5(serialize($this));
     106    }
    104107
    105     /**
    106      * Author's name
    107      *
    108      * @return string|null
    109      */
    110     public function get_name()
    111     {
    112         if ($this->name !== null)
    113         {
    114             return $this->name;
    115         }
     108    /**
     109     * Author's name
     110     *
     111     * @return string|null
     112     */
     113    public function get_name()
     114    {
     115        if ($this->name !== null) {
     116            return $this->name;
     117        }
    116118
    117         return null;
    118     }
     119        return null;
     120    }
    119121
    120     /**
    121      * Author's link
    122      *
    123      * @return string|null
    124      */
    125     public function get_link()
    126     {
    127         if ($this->link !== null)
    128         {
    129             return $this->link;
    130         }
     122    /**
     123     * Author's link
     124     *
     125     * @return string|null
     126     */
     127    public function get_link()
     128    {
     129        if ($this->link !== null) {
     130            return $this->link;
     131        }
    131132
    132         return null;
    133     }
     133        return null;
     134    }
    134135
    135     /**
    136      * Author's email address
    137      *
    138      * @return string|null
    139      */
    140     public function get_email()
    141     {
    142         if ($this->email !== null)
    143         {
    144             return $this->email;
    145         }
     136    /**
     137     * Author's email address
     138     *
     139     * @return string|null
     140     */
     141    public function get_email()
     142    {
     143        if ($this->email !== null) {
     144            return $this->email;
     145        }
    146146
    147         return null;
    148     }
     147        return null;
     148    }
    149149}
     150
     151class_alias('SimplePie\Author', 'SimplePie_Author');
Note: See TracChangeset for help on using the changeset viewer.