Changeset 11600
- Timestamp:
- 06/18/2009 07:38:23 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.8/wp-includes/class-simplepie.php
r10747 r11600 752 752 function __destruct() 753 753 { 754 if (!empty($this->data['items'])) 755 { 756 foreach ($this->data['items'] as $item) 757 { 758 $item->__destruct(); 759 } 760 unset($this->data['items']); 761 } 762 if (!empty($this->data['ordered_items'])) 763 { 764 foreach ($this->data['ordered_items'] as $item) 765 { 766 $item->__destruct(); 767 } 768 unset($this->data['ordered_items']); 754 if (version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) 755 { 756 if (!empty($this->data['items'])) 757 { 758 foreach ($this->data['items'] as $item) 759 { 760 $item->__destruct(); 761 } 762 unset($item, $this->data['items']); 763 } 764 if (!empty($this->data['ordered_items'])) 765 { 766 foreach ($this->data['ordered_items'] as $item) 767 { 768 $item->__destruct(); 769 } 770 unset($item, $this->data['ordered_items']); 771 } 769 772 } 770 773 } … … 3083 3086 function __destruct() 3084 3087 { 3085 unset($this->feed); 3088 if (version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) 3089 { 3090 unset($this->feed); 3091 } 3086 3092 } 3087 3093 … … 5683 5689 } 5684 5690 5685 /**5686 * Remove items that link back to this before destroying this object5687 */5688 function __destruct()5689 {5690 unset($this->item);5691 }5692 5693 5691 function get_source_tags($namespace, $tag) 5694 5692 { … … 8955 8953 function parse_url($url) 8956 8954 { 8957 static $cache = array(); 8958 if (isset($cache[$url])) 8959 { 8960 return $cache[$url]; 8961 } 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 } 8955 preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match); 8956 for ($i = count($match); $i <= 9; $i++) 8957 { 8958 $match[$i] = ''; 8959 } 8960 return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]); 8974 8961 } 8975 8962 … … 10810 10797 function codepoint_to_utf8($codepoint) 10811 10798 { 10812 static $cache = array();10813 10799 $codepoint = (int) $codepoint; 10814 if (isset($cache[$codepoint])) 10815 { 10816 return $cache[$codepoint]; 10817 } 10818 elseif ($codepoint < 0) 10819 { 10820 return $cache[$codepoint] = false; 10800 if ($codepoint < 0) 10801 { 10802 return false; 10821 10803 } 10822 10804 else if ($codepoint <= 0x7f) 10823 10805 { 10824 return $cache[$codepoint] =chr($codepoint);10806 return chr($codepoint); 10825 10807 } 10826 10808 else if ($codepoint <= 0x7ff) 10827 10809 { 10828 return $cache[$codepoint] =chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));10810 return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f)); 10829 10811 } 10830 10812 else if ($codepoint <= 0xffff) 10831 10813 { 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)); 10833 10815 } 10834 10816 else if ($codepoint <= 0x10ffff) 10835 10817 { 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)); 10837 10819 } 10838 10820 else 10839 10821 { 10840 10822 // U+FFFD REPLACEMENT CHARACTER 10841 return $cache[$codepoint] ="\xEF\xBF\xBD";10823 return "\xEF\xBF\xBD"; 10842 10824 } 10843 10825 }
Note: See TracChangeset
for help on using the changeset viewer.