Make WordPress Core


Ignore:
Timestamp:
09/30/2024 10:48:16 PM (2 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/Copyright.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 `<media:copyright>` copyright tags as defined in Media RSS
    4649 *
    47  * Used by {@see SimplePie_Enclosure::get_copyright()}
     50 * Used by {@see \SimplePie\Enclosure::get_copyright()}
    4851 *
    49  * This class can be overloaded with {@see SimplePie::set_copyright_class()}
     52 * This class can be overloaded with {@see \SimplePie\SimplePie::set_copyright_class()}
    5053 *
    5154 * @package SimplePie
    5255 * @subpackage API
    5356 */
    54 class SimplePie_Copyright
     57class Copyright
    5558{
    56     /**
    57     * Copyright URL
    58     *
    59     * @var string
    60     * @see get_url()
    61     */
    62     var $url;
     59    /**
     60    * Copyright URL
     61    *
     62    * @var string
     63    * @see get_url()
     64    */
     65    public $url;
    6366
    64     /**
    65     * Attribution
    66     *
    67     * @var string
    68     * @see get_attribution()
    69     */
    70     var $label;
     67    /**
     68    * Attribution
     69    *
     70    * @var string
     71    * @see get_attribution()
     72    */
     73    public $label;
    7174
    72     /**
    73     * Constructor, used to input the data
    74     *
    75     * For documentation on all the parameters, see the corresponding
    76     * properties and their accessors
    77     */
    78     public function __construct($url = null, $label = null)
    79     {
    80         $this->url = $url;
    81         $this->label = $label;
    82     }
     75    /**
     76    * Constructor, used to input the data
     77    *
     78    * For documentation on all the parameters, see the corresponding
     79    * properties and their accessors
     80    */
     81    public function __construct($url = null, $label = null)
     82    {
     83        $this->url = $url;
     84        $this->label = $label;
     85    }
    8386
    84     /**
    85     * String-ified version
    86     *
    87     * @return string
    88     */
    89     public function __toString()
    90     {
    91         // There is no $this->data here
    92         return md5(serialize($this));
    93     }
     87    /**
     88    * String-ified version
     89    *
     90    * @return string
     91    */
     92    public function __toString()
     93    {
     94        // There is no $this->data here
     95        return md5(serialize($this));
     96    }
    9497
    95     /**
    96      * Get the copyright URL
    97      *
    98      * @return string|null URL to copyright information
    99      */
    100     public function get_url()
    101     {
    102         if ($this->url !== null)
    103         {
    104             return $this->url;
    105         }
     98    /**
     99     * Get the copyright URL
     100     *
     101     * @return string|null URL to copyright information
     102     */
     103    public function get_url()
     104    {
     105        if ($this->url !== null) {
     106            return $this->url;
     107        }
    106108
    107         return null;
    108     }
     109        return null;
     110    }
    109111
    110     /**
    111      * Get the attribution text
    112      *
    113      * @return string|null
    114      */
    115     public function get_attribution()
    116     {
    117         if ($this->label !== null)
    118         {
    119             return $this->label;
    120         }
     112    /**
     113     * Get the attribution text
     114     *
     115     * @return string|null
     116     */
     117    public function get_attribution()
     118    {
     119        if ($this->label !== null) {
     120            return $this->label;
     121        }
    121122
    122         return null;
    123     }
     123        return null;
     124    }
    124125}
     126
     127class_alias('SimplePie\Copyright', 'SimplePie_Copyright');
Note: See TracChangeset for help on using the changeset viewer.