From 8469014d18adb3dca771bcf05f099b4528f243d1 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 10 Dec 2014 13:28:29 +0300 Subject: [PATCH] Fix more notices, one of which was actually caused by a bug --- fof-db.php | 13 +- fof-main.php | 14 +- plugins/enclosures.php | 20 ++- simplepie/simplepie.php | 4 +- simplepie/simplepie.php.diff | 270 ++++++++++++++++++----------------- 5 files changed, 164 insertions(+), 157 deletions(-) diff --git a/fof-db.php b/fof-db.php index 9606d9f..4d97de4 100644 --- a/fof-db.php +++ b/fof-db.php @@ -482,12 +482,12 @@ function fof_db_get_subscription_to_tags() { $prefs = unserialize($row['subscription_prefs']); $tags = $prefs['tags']; - if(!is_array($r[$row['feed_id']])) + if (!isset($r[$row['feed_id']])) $r[$row['feed_id']] = array(); $r[$row['feed_id']][$row['user_id']] = $tags; - if ($prefs['filter']) + if (!empty($prefs['filter'])) { - if(!is_array($r['filter'][$row['feed_id']])) + if (!isset($r['filter'][$row['feed_id']])) $r['filter'][$row['feed_id']] = array(); $r['filter'][$row['feed_id']][$row['user_id']] = $prefs['filter']; } @@ -768,10 +768,11 @@ function fof_db_get_users() $result = fof_safe_query("select user_name, user_id, user_prefs from $FOF_USER_TABLE"); - while($row = fof_db_get_row($result)) + $users = array(); + while ($row = fof_db_get_row($result)) { - $users[$row['user_id']['user_name']] = $row['user_name']; - $users[$row['user_id']['user_prefs']] = unserialize($row['user_prefs']); + $users[$row['user_id']]['user_name'] = $row['user_name']; + $users[$row['user_id']]['user_prefs'] = unserialize($row['user_prefs']); } } diff --git a/fof-main.php b/fof-main.php index 44e1c22..5fc55f8 100644 --- a/fof-main.php +++ b/fof-main.php @@ -686,9 +686,12 @@ function fof_apply_tags($item) $filtered[$user_id] = true; // regexp filter items - foreach((array)$fof_subscription_to_tags['filter'][$item['feed_id']] as $user_id => $filter) - if ($filter && (preg_match($filter, $title) || preg_match($filter, $content))) - $filtered[$user_id] = true; + if (isset($fof_subscription_to_tags['filter'][$item['feed_id']])) + { + foreach ((array)$fof_subscription_to_tags['filter'][$item['feed_id']] as $user_id => $filter) + if ($filter && (preg_match($filter, $title) || preg_match($filter, $content))) + $filtered[$user_id] = true; + } // mark item as unread for some users fof_db_mark_item_unread($item['item_id'], array_keys($filtered)); @@ -749,7 +752,7 @@ function fof_update_feed($id, $as_user = NULL) $feed_id = $feed['feed_id']; $n = 0; - if ($feed['feed_filter']) + if (!empty($feed['feed_filter'])) { $filter = @unserialize($feed['feed_filter']); if (!$filter || !$filter['re'] || !$filter['tags']) @@ -827,7 +830,8 @@ function fof_update_feed($id, $as_user = NULL) $p = FoF_Prefs::instance(); $admin_prefs = $p->admin_prefs; - if($admin_prefs['purge'] != "") + $ndelete = 0; + if ($admin_prefs['purge'] != "") { fof_log('purge is ' . $admin_prefs['purge']); $count = count($ids); diff --git a/plugins/enclosures.php b/plugins/enclosures.php index 2050ad9..4449b8a 100644 --- a/plugins/enclosures.php +++ b/plugins/enclosures.php @@ -1,9 +1,10 @@ -get_enclosure(0)) { $html = '

show enclosure
'; @@ -13,17 +14,14 @@ function fof_enclosures($item, $link, $title, $content) 'mediaplayer' => 'plugins/mediaplayer.swf', 'alt' => '', 'altclass' => 'download' - )) . '

'; + )) . '

'; $html .= '(' . $enclosure->get_type(); - if ($enclosure->get_size()) - { - $html .= '; ' . $enclosure->get_size() . ' MB'; - - } - $html .= ')'; + if ($enclosure->get_size()) + { + $html .= '; ' . $enclosure->get_size() . ' MB'; + } + $html .= ')'; $html .= '
'; } - - return array($link, $title, $content . $html); + return array($link, $title, $content . $html); } -?> diff --git a/simplepie/simplepie.php b/simplepie/simplepie.php index aae279b..7e25017 100644 --- a/simplepie/simplepie.php +++ b/simplepie/simplepie.php @@ -1987,7 +1987,9 @@ class SimplePie } else { - $file = new $this->file_class($favicon, $this->timeout / 10, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen); + $file = new $this->file_class($favicon, $this->timeout / 10, 5, + isset($_SERVER['REMOTE_ADDR']) ? array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']) : array(), + $this->useragent, $this->force_fsockopen); if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0) { diff --git a/simplepie/simplepie.php.diff b/simplepie/simplepie.php.diff index 3650178..289fe14 100644 --- a/simplepie/simplepie.php.diff +++ b/simplepie/simplepie.php.diff @@ -1,5 +1,5 @@ ---- simplepie.php.orig 2014-12-09 01:45:22.705342569 +0300 -+++ simplepie.php 2014-12-09 01:45:29.873342765 +0300 +--- simplepie.php.orig 2014-12-10 13:14:28.869989804 +0300 ++++ simplepie.php 2014-12-10 13:15:26.837991383 +0300 @@ -43,6 +43,10 @@ * @todo phpDoc comments */ @@ -123,12 +123,14 @@ // If it's parsed fine if ($parser->parse($utf8_data, 'UTF-8')) -@@ -1970,11 +1987,11 @@ class SimplePie +@@ -1970,11 +1987,13 @@ class SimplePie } else { - $file =& new $this->file_class($favicon, $this->timeout / 10, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen); -+ $file = new $this->file_class($favicon, $this->timeout / 10, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen); ++ $file = new $this->file_class($favicon, $this->timeout / 10, 5, ++ isset($_SERVER['REMOTE_ADDR']) ? array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']) : array(), ++ $this->useragent, $this->force_fsockopen); if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0) { @@ -137,7 +139,7 @@ if (substr($sniffer->get_type(), 0, 6) === 'image/') { if ($cache->save(array('headers' => $file->headers, 'body' => $file->body))) -@@ -2373,7 +2390,7 @@ class SimplePie +@@ -2373,7 +2392,7 @@ class SimplePie { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -146,7 +148,7 @@ } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { -@@ -2388,15 +2405,15 @@ class SimplePie +@@ -2388,15 +2407,15 @@ class SimplePie { $scheme = null; } @@ -165,7 +167,7 @@ } if (!empty($categories)) -@@ -2444,7 +2461,7 @@ class SimplePie +@@ -2444,7 +2463,7 @@ class SimplePie } if ($name !== null || $email !== null || $uri !== null) { @@ -174,7 +176,7 @@ } } if ($author = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author')) -@@ -2466,20 +2483,20 @@ class SimplePie +@@ -2466,20 +2485,20 @@ class SimplePie } if ($name !== null || $email !== null || $url !== null) { @@ -199,7 +201,7 @@ } if (!empty($authors)) -@@ -2527,7 +2544,7 @@ class SimplePie +@@ -2527,7 +2546,7 @@ class SimplePie } if ($name !== null || $email !== null || $uri !== null) { @@ -208,7 +210,7 @@ } } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor) -@@ -2549,7 +2566,7 @@ class SimplePie +@@ -2549,7 +2568,7 @@ class SimplePie } if ($name !== null || $email !== null || $url !== null) { @@ -217,7 +219,7 @@ } } -@@ -2962,7 +2979,7 @@ class SimplePie +@@ -2962,7 +2981,7 @@ class SimplePie $keys = array_keys($items); foreach ($keys as $key) { @@ -226,7 +228,7 @@ } } if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry')) -@@ -2970,7 +2987,7 @@ class SimplePie +@@ -2970,7 +2989,7 @@ class SimplePie $keys = array_keys($items); foreach ($keys as $key) { @@ -235,7 +237,7 @@ } } if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item')) -@@ -2978,7 +2995,7 @@ class SimplePie +@@ -2978,7 +2997,7 @@ class SimplePie $keys = array_keys($items); foreach ($keys as $key) { @@ -244,7 +246,7 @@ } } if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item')) -@@ -2986,7 +3003,7 @@ class SimplePie +@@ -2986,7 +3005,7 @@ class SimplePie $keys = array_keys($items); foreach ($keys as $key) { @@ -253,7 +255,7 @@ } } if ($items = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'item')) -@@ -2994,7 +3011,7 @@ class SimplePie +@@ -2994,7 +3013,7 @@ class SimplePie $keys = array_keys($items); foreach ($keys as $key) { @@ -262,7 +264,7 @@ } } } -@@ -3049,7 +3066,7 @@ class SimplePie +@@ -3049,7 +3068,7 @@ class SimplePie /** * @static */ @@ -271,7 +273,7 @@ { return $a->get_date('U') <= $b->get_date('U'); } -@@ -3057,7 +3074,7 @@ class SimplePie +@@ -3057,7 +3076,7 @@ class SimplePie /** * @static */ @@ -280,7 +282,7 @@ { if (is_array($urls) && sizeof($urls) > 0) { -@@ -3345,7 +3362,7 @@ class SimplePie_Item +@@ -3345,7 +3364,7 @@ class SimplePie_Item { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -289,7 +291,7 @@ } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { -@@ -3360,15 +3377,15 @@ class SimplePie_Item +@@ -3360,15 +3379,15 @@ class SimplePie_Item { $scheme = null; } @@ -308,7 +310,7 @@ } if (!empty($categories)) -@@ -3429,7 +3446,7 @@ class SimplePie_Item +@@ -3429,7 +3448,7 @@ class SimplePie_Item } if ($name !== null || $email !== null || $uri !== null) { @@ -317,7 +319,7 @@ } } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor) -@@ -3451,7 +3468,7 @@ class SimplePie_Item +@@ -3451,7 +3470,7 @@ class SimplePie_Item } if ($name !== null || $email !== null || $url !== null) { @@ -326,7 +328,7 @@ } } -@@ -3487,7 +3504,7 @@ class SimplePie_Item +@@ -3487,7 +3506,7 @@ class SimplePie_Item } if ($name !== null || $email !== null || $uri !== null) { @@ -335,7 +337,7 @@ } } if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author')) -@@ -3509,24 +3526,24 @@ class SimplePie_Item +@@ -3509,24 +3528,24 @@ class SimplePie_Item } if ($name !== null || $email !== null || $url !== null) { @@ -365,7 +367,7 @@ } if (!empty($authors)) -@@ -3836,7 +3853,7 @@ class SimplePie_Item +@@ -3836,7 +3855,7 @@ class SimplePie_Item { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -374,7 +376,7 @@ } } elseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text')) -@@ -3868,7 +3885,7 @@ class SimplePie_Item +@@ -3868,7 +3887,7 @@ class SimplePie_Item { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -383,7 +385,7 @@ } } if (is_array($captions_parent)) -@@ -3898,7 +3915,7 @@ class SimplePie_Item +@@ -3898,7 +3917,7 @@ class SimplePie_Item { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -392,7 +394,7 @@ } foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category) { -@@ -3921,7 +3938,7 @@ class SimplePie_Item +@@ -3921,7 +3940,7 @@ class SimplePie_Item { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -401,7 +403,7 @@ } foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'category') as $category) { -@@ -3932,7 +3949,7 @@ class SimplePie_Item +@@ -3932,7 +3951,7 @@ class SimplePie_Item { $label = $this->sanitize($category['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -410,7 +412,7 @@ if (isset($category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category'])) { -@@ -3942,7 +3959,7 @@ class SimplePie_Item +@@ -3942,7 +3961,7 @@ class SimplePie_Item { $label = $this->sanitize($subcategory['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -419,7 +421,7 @@ } } } -@@ -3964,7 +3981,7 @@ class SimplePie_Item +@@ -3964,7 +3983,7 @@ class SimplePie_Item { $copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -428,7 +430,7 @@ } elseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright')) { -@@ -3978,7 +3995,7 @@ class SimplePie_Item +@@ -3978,7 +3997,7 @@ class SimplePie_Item { $copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -437,7 +439,7 @@ } // CREDITS -@@ -4005,7 +4022,7 @@ class SimplePie_Item +@@ -4005,7 +4024,7 @@ class SimplePie_Item { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -446,7 +448,7 @@ } } elseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit')) -@@ -4031,7 +4048,7 @@ class SimplePie_Item +@@ -4031,7 +4050,7 @@ class SimplePie_Item { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -455,7 +457,7 @@ } } if (is_array($credits_parent)) -@@ -4220,7 +4237,7 @@ class SimplePie_Item +@@ -4220,7 +4239,7 @@ class SimplePie_Item { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -464,7 +466,7 @@ } } elseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit')) -@@ -4233,7 +4250,7 @@ class SimplePie_Item +@@ -4233,7 +4252,7 @@ class SimplePie_Item { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -473,7 +475,7 @@ } } elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating')) -@@ -4254,7 +4271,7 @@ class SimplePie_Item +@@ -4254,7 +4273,7 @@ class SimplePie_Item { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -482,7 +484,7 @@ } } elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit')) -@@ -4267,7 +4284,7 @@ class SimplePie_Item +@@ -4267,7 +4286,7 @@ class SimplePie_Item { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -491,7 +493,7 @@ } } if (is_array($ratings_parent)) -@@ -4295,7 +4312,7 @@ class SimplePie_Item +@@ -4295,7 +4314,7 @@ class SimplePie_Item { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -500,7 +502,7 @@ } } elseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block')) -@@ -4309,7 +4326,7 @@ class SimplePie_Item +@@ -4309,7 +4328,7 @@ class SimplePie_Item { $restriction_relationship = 'deny'; } @@ -509,7 +511,7 @@ } } elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction')) -@@ -4331,7 +4348,7 @@ class SimplePie_Item +@@ -4331,7 +4350,7 @@ class SimplePie_Item { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -518,7 +520,7 @@ } } elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block')) -@@ -4345,7 +4362,7 @@ class SimplePie_Item +@@ -4345,7 +4364,7 @@ class SimplePie_Item { $restriction_relationship = 'deny'; } @@ -527,7 +529,7 @@ } } if (is_array($restrictions_parent)) -@@ -4549,7 +4566,7 @@ class SimplePie_Item +@@ -4549,7 +4568,7 @@ class SimplePie_Item { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -536,7 +538,7 @@ } if (is_array($captions)) { -@@ -4585,7 +4602,7 @@ class SimplePie_Item +@@ -4585,7 +4604,7 @@ class SimplePie_Item { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -545,7 +547,7 @@ } if (is_array($captions)) { -@@ -4621,7 +4638,7 @@ class SimplePie_Item +@@ -4621,7 +4640,7 @@ class SimplePie_Item { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -554,7 +556,7 @@ } } if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'])) -@@ -4647,7 +4664,7 @@ class SimplePie_Item +@@ -4647,7 +4666,7 @@ class SimplePie_Item { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -563,7 +565,7 @@ } } if (is_array($categories) && is_array($categories_parent)) -@@ -4676,7 +4693,7 @@ class SimplePie_Item +@@ -4676,7 +4695,7 @@ class SimplePie_Item { $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -572,7 +574,7 @@ } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'])) { -@@ -4690,7 +4707,7 @@ class SimplePie_Item +@@ -4690,7 +4709,7 @@ class SimplePie_Item { $copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -581,7 +583,7 @@ } else { -@@ -4721,7 +4738,7 @@ class SimplePie_Item +@@ -4721,7 +4740,7 @@ class SimplePie_Item { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -590,7 +592,7 @@ } if (is_array($credits)) { -@@ -4751,7 +4768,7 @@ class SimplePie_Item +@@ -4751,7 +4770,7 @@ class SimplePie_Item { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -599,7 +601,7 @@ } if (is_array($credits)) { -@@ -4904,7 +4921,7 @@ class SimplePie_Item +@@ -4904,7 +4923,7 @@ class SimplePie_Item { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -608,7 +610,7 @@ } if (is_array($ratings)) { -@@ -4929,7 +4946,7 @@ class SimplePie_Item +@@ -4929,7 +4948,7 @@ class SimplePie_Item { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -617,7 +619,7 @@ } if (is_array($ratings)) { -@@ -4961,7 +4978,7 @@ class SimplePie_Item +@@ -4961,7 +4980,7 @@ class SimplePie_Item { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -626,7 +628,7 @@ } if (is_array($restrictions)) { -@@ -4987,7 +5004,7 @@ class SimplePie_Item +@@ -4987,7 +5006,7 @@ class SimplePie_Item { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -635,7 +637,7 @@ } if (is_array($restrictions)) { -@@ -5041,7 +5058,7 @@ class SimplePie_Item +@@ -5041,7 +5060,7 @@ class SimplePie_Item $title = $title_parent; } @@ -644,7 +646,7 @@ } } } -@@ -5170,7 +5187,7 @@ class SimplePie_Item +@@ -5170,7 +5189,7 @@ class SimplePie_Item { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -653,7 +655,7 @@ } if (is_array($captions)) { -@@ -5206,7 +5223,7 @@ class SimplePie_Item +@@ -5206,7 +5225,7 @@ class SimplePie_Item { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -662,7 +664,7 @@ } } if (is_array($categories) && is_array($categories_parent)) -@@ -5239,7 +5256,7 @@ class SimplePie_Item +@@ -5239,7 +5258,7 @@ class SimplePie_Item { $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -671,7 +673,7 @@ } else { -@@ -5270,7 +5287,7 @@ class SimplePie_Item +@@ -5270,7 +5289,7 @@ class SimplePie_Item { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -680,7 +682,7 @@ } if (is_array($credits)) { -@@ -5374,7 +5391,7 @@ class SimplePie_Item +@@ -5374,7 +5393,7 @@ class SimplePie_Item { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -689,7 +691,7 @@ } if (is_array($ratings)) { -@@ -5406,7 +5423,7 @@ class SimplePie_Item +@@ -5406,7 +5425,7 @@ class SimplePie_Item { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -698,7 +700,7 @@ } if (is_array($restrictions)) { -@@ -5445,7 +5462,7 @@ class SimplePie_Item +@@ -5445,7 +5464,7 @@ class SimplePie_Item $title = $title_parent; } @@ -707,7 +709,7 @@ } } } -@@ -5481,7 +5498,7 @@ class SimplePie_Item +@@ -5481,7 +5500,7 @@ class SimplePie_Item } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor @@ -716,7 +718,7 @@ } } -@@ -5516,7 +5533,7 @@ class SimplePie_Item +@@ -5516,7 +5535,7 @@ class SimplePie_Item } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor @@ -725,7 +727,7 @@ } } -@@ -5551,14 +5568,14 @@ class SimplePie_Item +@@ -5551,14 +5570,14 @@ class SimplePie_Item } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor @@ -742,7 +744,7 @@ } $this->data['enclosures'] = array_values(SimplePie_Misc::array_unique($this->data['enclosures'])); -@@ -5835,7 +5852,7 @@ class SimplePie_Source +@@ -5835,7 +5854,7 @@ class SimplePie_Source { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -751,7 +753,7 @@ } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { -@@ -5850,15 +5867,15 @@ class SimplePie_Source +@@ -5850,15 +5869,15 @@ class SimplePie_Source { $scheme = null; } @@ -770,7 +772,7 @@ } if (!empty($categories)) -@@ -5906,7 +5923,7 @@ class SimplePie_Source +@@ -5906,7 +5925,7 @@ class SimplePie_Source } if ($name !== null || $email !== null || $uri !== null) { @@ -779,7 +781,7 @@ } } if ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author')) -@@ -5928,20 +5945,20 @@ class SimplePie_Source +@@ -5928,20 +5947,20 @@ class SimplePie_Source } if ($name !== null || $email !== null || $url !== null) { @@ -804,7 +806,7 @@ } if (!empty($authors)) -@@ -5989,7 +6006,7 @@ class SimplePie_Source +@@ -5989,7 +6008,7 @@ class SimplePie_Source } if ($name !== null || $email !== null || $uri !== null) { @@ -813,7 +815,7 @@ } } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor) -@@ -6011,7 +6028,7 @@ class SimplePie_Source +@@ -6011,7 +6030,7 @@ class SimplePie_Source } if ($name !== null || $email !== null || $url !== null) { @@ -822,7 +824,7 @@ } } -@@ -6448,7 +6465,7 @@ class SimplePie_Enclosure +@@ -6448,7 +6467,7 @@ class SimplePie_Enclosure $this->width = $width; if (class_exists('idna_convert')) { @@ -831,7 +833,7 @@ $parsed = SimplePie_Misc::parse_url($link); $this->link = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']); } -@@ -7655,7 +7672,7 @@ class SimplePie_File +@@ -7655,7 +7674,7 @@ class SimplePie_File { if (class_exists('idna_convert')) { @@ -840,7 +842,7 @@ $parsed = SimplePie_Misc::parse_url($url); $url = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']); } -@@ -7687,6 +7704,15 @@ class SimplePie_File +@@ -7687,6 +7706,15 @@ class SimplePie_File { curl_setopt($fp, CURLOPT_ENCODING, ''); } @@ -856,7 +858,7 @@ curl_setopt($fp, CURLOPT_URL, $url); curl_setopt($fp, CURLOPT_HEADER, 1); curl_setopt($fp, CURLOPT_RETURNTRANSFER, 1); -@@ -7701,6 +7727,10 @@ class SimplePie_File +@@ -7701,6 +7729,10 @@ class SimplePie_File curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects); } @@ -867,7 +869,7 @@ $this->headers = curl_exec($fp); if (curl_errno($fp) === 23 || curl_errno($fp) === 61) { -@@ -7718,7 +7748,7 @@ class SimplePie_File +@@ -7718,7 +7750,7 @@ class SimplePie_File curl_close($fp); $this->headers = explode("\r\n\r\n", $this->headers, $info['redirect_count'] + 1); $this->headers = array_pop($this->headers); @@ -876,7 +878,7 @@ if ($parser->parse()) { $this->headers = $parser->headers; -@@ -7799,7 +7829,7 @@ class SimplePie_File +@@ -7799,7 +7831,7 @@ class SimplePie_File } if (!$info['timed_out']) { @@ -885,7 +887,7 @@ if ($parser->parse()) { $this->headers = $parser->headers; -@@ -7818,7 +7848,7 @@ class SimplePie_File +@@ -7818,7 +7850,7 @@ class SimplePie_File { case 'gzip': case 'x-gzip': @@ -894,7 +896,7 @@ if (!$decoder->parse()) { $this->error = 'Unable to decode HTTP "gzip" stream'; -@@ -8628,9 +8658,9 @@ class SimplePie_Cache +@@ -8628,9 +8660,9 @@ class SimplePie_Cache * @static * @access public */ @@ -906,7 +908,7 @@ switch ($location_iri->get_scheme()) { case 'mysql': -@@ -9081,7 +9111,7 @@ class SimplePie_Cache_MySQL extends Simp +@@ -9081,7 +9113,7 @@ class SimplePie_Cache_MySQL extends Simp class SimplePie_Misc { @@ -915,7 +917,7 @@ { $time = ''; -@@ -9109,13 +9139,13 @@ class SimplePie_Misc +@@ -9109,13 +9141,13 @@ class SimplePie_Misc return $time; } @@ -931,7 +933,7 @@ { $output = ''; while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') -@@ -9169,7 +9199,7 @@ class SimplePie_Misc +@@ -9169,7 +9201,7 @@ class SimplePie_Misc return $output . $input; } @@ -940,7 +942,7 @@ { $return = array(); $name = preg_quote($realname, '/'); -@@ -9206,7 +9236,7 @@ class SimplePie_Misc +@@ -9206,7 +9238,7 @@ class SimplePie_Misc return $return; } @@ -949,7 +951,7 @@ { $full = "<$element[tag]"; foreach ($element['attribs'] as $key => $value) -@@ -9225,7 +9255,7 @@ class SimplePie_Misc +@@ -9225,7 +9257,7 @@ class SimplePie_Misc return $full; } @@ -958,7 +960,7 @@ { if ((ini_get('error_reporting') & $level) > 0) { -@@ -9271,7 +9301,7 @@ class SimplePie_Misc +@@ -9271,7 +9303,7 @@ class SimplePie_Misc * @param str $cache_name_function Obsolete. Exists for backwards * compatibility reasons only. */ @@ -967,7 +969,7 @@ { $cache = call_user_func(array($cache_class, 'create'), $cache_location, $identifier_url, $cache_extension); -@@ -9293,7 +9323,7 @@ class SimplePie_Misc +@@ -9293,7 +9325,7 @@ class SimplePie_Misc die('Cached file for ' . $identifier_url . ' cannot be found.'); } @@ -976,7 +978,7 @@ { $url = SimplePie_Misc::normalize_url($url); $parsed = SimplePie_Misc::parse_url($url); -@@ -9325,9 +9355,9 @@ class SimplePie_Misc +@@ -9325,9 +9357,9 @@ class SimplePie_Misc } } @@ -988,7 +990,7 @@ return array( 'scheme' => (string) $iri->get_scheme(), 'authority' => (string) $iri->get_authority(), -@@ -9337,9 +9367,9 @@ class SimplePie_Misc +@@ -9337,9 +9369,9 @@ class SimplePie_Misc ); } @@ -1000,7 +1002,7 @@ $iri->set_scheme($scheme); $iri->set_authority($authority); $iri->set_path($path); -@@ -9348,13 +9378,13 @@ class SimplePie_Misc +@@ -9348,13 +9380,13 @@ class SimplePie_Misc return $iri->get_iri(); } @@ -1017,7 +1019,7 @@ { $integer = hexdec($match[1]); if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E) -@@ -9378,7 +9408,7 @@ class SimplePie_Misc +@@ -9378,7 +9410,7 @@ class SimplePie_Misc * @param string $str String to remove bad UTF-8 bytes from * @return string UTF-8 string */ @@ -1026,7 +1028,7 @@ { if (function_exists('iconv') && ($return = @iconv('UTF-8', 'UTF-8//IGNORE', $str))) { -@@ -9410,14 +9440,14 @@ class SimplePie_Misc +@@ -9410,14 +9442,14 @@ class SimplePie_Misc * @param string $string Windows-1252 encoded string * @return string UTF-8 encoded string */ @@ -1043,7 +1045,7 @@ { $input = SimplePie_Misc::encoding($input); $output = SimplePie_Misc::encoding($output); -@@ -9458,7 +9488,7 @@ class SimplePie_Misc +@@ -9458,7 +9490,7 @@ class SimplePie_Misc } } @@ -1052,7 +1054,7 @@ { // Normalization from UTS #22 switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset))) -@@ -10774,7 +10804,7 @@ class SimplePie_Misc +@@ -10774,7 +10806,7 @@ class SimplePie_Misc } } @@ -1061,7 +1063,7 @@ { if (is_array($curl = curl_version())) { -@@ -10795,7 +10825,7 @@ class SimplePie_Misc +@@ -10795,7 +10827,7 @@ class SimplePie_Misc return $curl; } @@ -1070,7 +1072,7 @@ { if (func_num_args() !== 2) { -@@ -10836,7 +10866,7 @@ class SimplePie_Misc +@@ -10836,7 +10868,7 @@ class SimplePie_Misc * @param string $data Data to strip comments from * @return string Comment stripped string */ @@ -1079,7 +1081,7 @@ { $output = ''; while (($start = strpos($data, '