Make WordPress Core

Ticket #10147: sp.diff

File sp.diff, 4.0 KB (added by link92, 15 years ago)
  • wp-includes/class-simplepie.php

     
    751751         */
    752752        function __destruct()
    753753        {
    754                 if (!empty($this->data['items']))
     754                if (version_compare(PHP_VERSION, '5.3', '<'))
    755755                {
    756                         foreach ($this->data['items'] as $item)
     756                        if (!empty($this->data['items']))
    757757                        {
    758                                 $item->__destruct();
     758                                foreach ($this->data['items'] as $item)
     759                                {
     760                                        $item->__destruct();
     761                                }
     762                                unset($item, $this->data['items']);
    759763                        }
    760                         unset($this->data['items']);
    761                 }
    762                 if (!empty($this->data['ordered_items']))
    763                 {
    764                         foreach ($this->data['ordered_items'] as $item)
     764                        if (!empty($this->data['ordered_items']))
    765765                        {
    766                                 $item->__destruct();
     766                                foreach ($this->data['ordered_items'] as $item)
     767                                {
     768                                        $item->__destruct();
     769                                }
     770                                unset($item, $this->data['ordered_items']);
    767771                        }
    768                         unset($this->data['ordered_items']);
    769772                }
    770773        }
    771774
     
    30823085         */
    30833086        function __destruct()
    30843087        {
    3085                 unset($this->feed);
     3088                if (version_compare(PHP_VERSION, '5.3', '<'))
     3089                {
     3090                        unset($this->feed);
     3091                }
    30863092        }
    30873093
    30883094        function get_item_tags($namespace, $tag)
     
    56825688                return md5(serialize($this->data));
    56835689        }
    56845690
    5685         /**
    5686          * Remove items that link back to this before destroying this object
    5687          */
    5688         function __destruct()
    5689         {
    5690                 unset($this->item);
    5691         }
    5692 
    56935691        function get_source_tags($namespace, $tag)
    56945692        {
    56955693                if (isset($this->data['child'][$namespace][$tag]))
     
    89548952
    89558953        function parse_url($url)
    89568954        {
    8957                 static $cache = array();
    8958                 if (isset($cache[$url]))
     8955                preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match);
     8956                for ($i = count($match); $i <= 9; $i++)
    89598957                {
    8960                         return $cache[$url];
     8958                        $match[$i] = '';
    89618959                }
    8962                 elseif (preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match))
    8963                 {
    8964                         for ($i = count($match); $i <= 9; $i++)
    8965                         {
    8966                                 $match[$i] = '';
    8967                         }
    8968                         return $cache[$url] = array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]);
    8969                 }
    8970                 else
    8971                 {
    8972                         return $cache[$url] = array('scheme' => '', 'authority' => '', 'path' => '', 'query' => '', 'fragment' => '');
    8973                 }
     8960                return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]);
    89748961        }
    89758962
    89768963        function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
     
    1080910796         */
    1081010797        function codepoint_to_utf8($codepoint)
    1081110798        {
    10812                 static $cache = array();
    1081310799                $codepoint = (int) $codepoint;
    10814                 if (isset($cache[$codepoint]))
     10800                if ($codepoint < 0)
    1081510801                {
    10816                         return $cache[$codepoint];
     10802                        return false;
    1081710803                }
    10818                 elseif ($codepoint < 0)
    10819                 {
    10820                         return $cache[$codepoint] = false;
    10821                 }
    1082210804                else if ($codepoint <= 0x7f)
    1082310805                {
    10824                         return $cache[$codepoint] = chr($codepoint);
     10806                        return chr($codepoint);
    1082510807                }
    1082610808                else if ($codepoint <= 0x7ff)
    1082710809                {
    10828                         return $cache[$codepoint] = chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
     10810                        return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
    1082910811                }
    1083010812                else if ($codepoint <= 0xffff)
    1083110813                {
    10832                         return $cache[$codepoint] = chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
     10814                        return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
    1083310815                }
    1083410816                else if ($codepoint <= 0x10ffff)
    1083510817                {
    10836                         return $cache[$codepoint] = chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
     10818                        return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
    1083710819                }
    1083810820                else
    1083910821                {
    1084010822                        // U+FFFD REPLACEMENT CHARACTER
    10841                         return $cache[$codepoint] = "\xEF\xBF\xBD";
     10823                        return "\xEF\xBF\xBD";
    1084210824                }
    1084310825        }
    1084410826
     
    1366913651        }
    1367013652}
    1367113653
    13672 ?>
    13673  No newline at end of file
     13654?>