Fix db, fix more statics in simplepie
parent
11e38784a4
commit
bfb1b36d19
|
@ -745,8 +745,8 @@ function fof_db_tag_items($user_id, $tag_id, $items)
|
|||
|
||||
$items = implode(',', (array)$items);
|
||||
$sql = "insert into $FOF_ITEM_TAG_TABLE (user_id, tag_id, item_id, item_published, feed_id)".
|
||||
" select %d, %d, item_id, item_published, feed_id from $FOF_ITEM_TABLE".
|
||||
" where item_id in ($items)".
|
||||
" select ".intval($user_id).", ".intval($tag_id).", item_id, item_published, feed_id".
|
||||
" from $FOF_ITEM_TABLE where item_id in ($items)".
|
||||
" on duplicate key update item_published=values(item_published)";
|
||||
|
||||
$result = fof_db_query($sql, 1);
|
||||
|
|
|
@ -3066,7 +3066,7 @@ class SimplePie
|
|||
/**
|
||||
* @static
|
||||
*/
|
||||
function sort_items($a, $b)
|
||||
static function sort_items($a, $b)
|
||||
{
|
||||
return $a->get_date('U') <= $b->get_date('U');
|
||||
}
|
||||
|
@ -3074,7 +3074,7 @@ class SimplePie
|
|||
/**
|
||||
* @static
|
||||
*/
|
||||
function merge_items($urls, $start = 0, $end = 0, $limit = 0)
|
||||
static function merge_items($urls, $start = 0, $end = 0, $limit = 0)
|
||||
{
|
||||
if (is_array($urls) && sizeof($urls) > 0)
|
||||
{
|
||||
|
@ -9111,7 +9111,7 @@ class SimplePie_Cache_MySQL extends SimplePie_Cache_DB
|
|||
|
||||
class SimplePie_Misc
|
||||
{
|
||||
function time_hms($seconds)
|
||||
static function time_hms($seconds)
|
||||
{
|
||||
$time = '';
|
||||
|
||||
|
@ -9139,13 +9139,13 @@ class SimplePie_Misc
|
|||
return $time;
|
||||
}
|
||||
|
||||
function absolutize_url($relative, $base)
|
||||
static function absolutize_url($relative, $base)
|
||||
{
|
||||
$iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);
|
||||
return $iri->get_iri();
|
||||
}
|
||||
|
||||
function remove_dot_segments($input)
|
||||
static function remove_dot_segments($input)
|
||||
{
|
||||
$output = '';
|
||||
while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')
|
||||
|
@ -9199,7 +9199,7 @@ class SimplePie_Misc
|
|||
return $output . $input;
|
||||
}
|
||||
|
||||
function get_element($realname, $string)
|
||||
static function get_element($realname, $string)
|
||||
{
|
||||
$return = array();
|
||||
$name = preg_quote($realname, '/');
|
||||
|
@ -9236,7 +9236,7 @@ class SimplePie_Misc
|
|||
return $return;
|
||||
}
|
||||
|
||||
function element_implode($element)
|
||||
static function element_implode($element)
|
||||
{
|
||||
$full = "<$element[tag]";
|
||||
foreach ($element['attribs'] as $key => $value)
|
||||
|
@ -9255,7 +9255,7 @@ class SimplePie_Misc
|
|||
return $full;
|
||||
}
|
||||
|
||||
function error($message, $level, $file, $line)
|
||||
static function error($message, $level, $file, $line)
|
||||
{
|
||||
if ((ini_get('error_reporting') & $level) > 0)
|
||||
{
|
||||
|
@ -9323,7 +9323,7 @@ class SimplePie_Misc
|
|||
die('Cached file for ' . $identifier_url . ' cannot be found.');
|
||||
}
|
||||
|
||||
function fix_protocol($url, $http = 1)
|
||||
static function fix_protocol($url, $http = 1)
|
||||
{
|
||||
$url = SimplePie_Misc::normalize_url($url);
|
||||
$parsed = SimplePie_Misc::parse_url($url);
|
||||
|
@ -9355,7 +9355,7 @@ class SimplePie_Misc
|
|||
}
|
||||
}
|
||||
|
||||
function parse_url($url)
|
||||
static function parse_url($url)
|
||||
{
|
||||
$iri = new SimplePie_IRI($url);
|
||||
return array(
|
||||
|
@ -9367,7 +9367,7 @@ class SimplePie_Misc
|
|||
);
|
||||
}
|
||||
|
||||
function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
|
||||
static function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
|
||||
{
|
||||
$iri = new SimplePie_IRI('');
|
||||
$iri->set_scheme($scheme);
|
||||
|
@ -9378,13 +9378,13 @@ class SimplePie_Misc
|
|||
return $iri->get_iri();
|
||||
}
|
||||
|
||||
function normalize_url($url)
|
||||
static function normalize_url($url)
|
||||
{
|
||||
$iri = new SimplePie_IRI($url);
|
||||
return $iri->get_iri();
|
||||
}
|
||||
|
||||
function percent_encoding_normalization($match)
|
||||
static function percent_encoding_normalization($match)
|
||||
{
|
||||
$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)
|
||||
|
@ -9408,7 +9408,7 @@ class SimplePie_Misc
|
|||
* @param string $str String to remove bad UTF-8 bytes from
|
||||
* @return string UTF-8 string
|
||||
*/
|
||||
function utf8_bad_replace($str)
|
||||
static function utf8_bad_replace($str)
|
||||
{
|
||||
if (function_exists('iconv') && ($return = @iconv('UTF-8', 'UTF-8//IGNORE', $str)))
|
||||
{
|
||||
|
@ -9440,14 +9440,14 @@ class SimplePie_Misc
|
|||
* @param string $string Windows-1252 encoded string
|
||||
* @return string UTF-8 encoded string
|
||||
*/
|
||||
function windows_1252_to_utf8($string)
|
||||
static function windows_1252_to_utf8($string)
|
||||
{
|
||||
static $convert_table = array("\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA8" => "\xC2\xA8", "\xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE" => "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" => "\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF");
|
||||
|
||||
return strtr($string, $convert_table);
|
||||
}
|
||||
|
||||
function change_encoding($data, $input, $output)
|
||||
static function change_encoding($data, $input, $output)
|
||||
{
|
||||
$input = SimplePie_Misc::encoding($input);
|
||||
$output = SimplePie_Misc::encoding($output);
|
||||
|
@ -9488,7 +9488,7 @@ class SimplePie_Misc
|
|||
}
|
||||
}
|
||||
|
||||
function encoding($charset)
|
||||
static function encoding($charset)
|
||||
{
|
||||
// Normalization from UTS #22
|
||||
switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset)))
|
||||
|
@ -10804,7 +10804,7 @@ class SimplePie_Misc
|
|||
}
|
||||
}
|
||||
|
||||
function get_curl_version()
|
||||
static function get_curl_version()
|
||||
{
|
||||
if (is_array($curl = curl_version()))
|
||||
{
|
||||
|
@ -10825,7 +10825,7 @@ class SimplePie_Misc
|
|||
return $curl;
|
||||
}
|
||||
|
||||
function is_subclass_of($class1, $class2)
|
||||
static function is_subclass_of($class1, $class2)
|
||||
{
|
||||
if (func_num_args() !== 2)
|
||||
{
|
||||
|
@ -10866,7 +10866,7 @@ class SimplePie_Misc
|
|||
* @param string $data Data to strip comments from
|
||||
* @return string Comment stripped string
|
||||
*/
|
||||
function strip_comments($data)
|
||||
static function strip_comments($data)
|
||||
{
|
||||
$output = '';
|
||||
while (($start = strpos($data, '<!--')) !== false)
|
||||
|
@ -10884,7 +10884,7 @@ class SimplePie_Misc
|
|||
return $output . $data;
|
||||
}
|
||||
|
||||
function parse_date($dt)
|
||||
static function parse_date($dt)
|
||||
{
|
||||
$parser = SimplePie_Parse_Date::get();
|
||||
return $parser->parse($dt);
|
||||
|
@ -10898,7 +10898,7 @@ class SimplePie_Misc
|
|||
* @param string $data Input data
|
||||
* @return string Output data
|
||||
*/
|
||||
function entities_decode($data)
|
||||
static function entities_decode($data)
|
||||
{
|
||||
$decoder = new SimplePie_Decode_HTML_Entities($data);
|
||||
return $decoder->parse();
|
||||
|
@ -10911,7 +10911,7 @@ class SimplePie_Misc
|
|||
* @param string $data Data to strip comments from
|
||||
* @return string Comment stripped string
|
||||
*/
|
||||
function uncomment_rfc822($string)
|
||||
static function uncomment_rfc822($string)
|
||||
{
|
||||
$string = (string) $string;
|
||||
$position = 0;
|
||||
|
@ -10965,7 +10965,7 @@ class SimplePie_Misc
|
|||
return $output;
|
||||
}
|
||||
|
||||
function parse_mime($mime)
|
||||
static function parse_mime($mime)
|
||||
{
|
||||
if (($pos = strpos($mime, ';')) === false)
|
||||
{
|
||||
|
@ -10977,7 +10977,7 @@ class SimplePie_Misc
|
|||
}
|
||||
}
|
||||
|
||||
function htmlspecialchars_decode($string, $quote_style)
|
||||
static function htmlspecialchars_decode($string, $quote_style)
|
||||
{
|
||||
if (function_exists('htmlspecialchars_decode'))
|
||||
{
|
||||
|
@ -10989,7 +10989,7 @@ class SimplePie_Misc
|
|||
}
|
||||
}
|
||||
|
||||
function atom_03_construct_type($attribs)
|
||||
static function atom_03_construct_type($attribs)
|
||||
{
|
||||
if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
|
||||
{
|
||||
|
@ -11025,7 +11025,7 @@ class SimplePie_Misc
|
|||
}
|
||||
}
|
||||
|
||||
function atom_10_construct_type($attribs)
|
||||
static function atom_10_construct_type($attribs)
|
||||
{
|
||||
if (isset($attribs['']['type']))
|
||||
{
|
||||
|
@ -11047,7 +11047,7 @@ class SimplePie_Misc
|
|||
return SIMPLEPIE_CONSTRUCT_TEXT;
|
||||
}
|
||||
|
||||
function atom_10_content_construct_type($attribs)
|
||||
static function atom_10_content_construct_type($attribs)
|
||||
{
|
||||
if (isset($attribs['']['type']))
|
||||
{
|
||||
|
@ -11078,12 +11078,12 @@ class SimplePie_Misc
|
|||
}
|
||||
}
|
||||
|
||||
function is_isegment_nz_nc($string)
|
||||
static function is_isegment_nz_nc($string)
|
||||
{
|
||||
return (bool) preg_match('/^([A-Za-z0-9\-._~\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}!$&\'()*+,;=@]|(%[0-9ABCDEF]{2}))+$/u', $string);
|
||||
}
|
||||
|
||||
function space_seperated_tokens($string)
|
||||
static function space_seperated_tokens($string)
|
||||
{
|
||||
$space_characters = "\x20\x09\x0A\x0B\x0C\x0D";
|
||||
$string_length = strlen($string);
|
||||
|
@ -11102,7 +11102,7 @@ class SimplePie_Misc
|
|||
return $tokens;
|
||||
}
|
||||
|
||||
function array_unique($array)
|
||||
static function array_unique($array)
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.2', '>='))
|
||||
{
|
||||
|
@ -11152,7 +11152,7 @@ class SimplePie_Misc
|
|||
* @param int $codepoint Unicode codepoint
|
||||
* @return string UTF-8 character
|
||||
*/
|
||||
function codepoint_to_utf8($codepoint)
|
||||
static function codepoint_to_utf8($codepoint)
|
||||
{
|
||||
$codepoint = (int) $codepoint;
|
||||
if ($codepoint < 0)
|
||||
|
@ -11199,7 +11199,7 @@ class SimplePie_Misc
|
|||
* relative to the beginning of haystack.
|
||||
* @return bool If needle is not found, stripos() will return boolean false.
|
||||
*/
|
||||
function stripos($haystack, $needle, $offset = 0)
|
||||
static function stripos($haystack, $needle, $offset = 0)
|
||||
{
|
||||
if (function_exists('stripos'))
|
||||
{
|
||||
|
@ -11236,7 +11236,7 @@ class SimplePie_Misc
|
|||
* @param string $str The input string.
|
||||
* @return array
|
||||
*/
|
||||
function parse_str($str)
|
||||
static function parse_str($str)
|
||||
{
|
||||
$return = array();
|
||||
$str = explode('&', $str);
|
||||
|
@ -11264,7 +11264,7 @@ class SimplePie_Misc
|
|||
* @param string $data XML data
|
||||
* @return array Possible encodings
|
||||
*/
|
||||
function xml_encoding($data)
|
||||
static function xml_encoding($data)
|
||||
{
|
||||
// UTF-32 Big Endian BOM
|
||||
if (substr($data, 0, 4) === "\x00\x00\xFE\xFF")
|
||||
|
@ -11364,7 +11364,7 @@ class SimplePie_Misc
|
|||
return $encoding;
|
||||
}
|
||||
|
||||
function output_javascript()
|
||||
static function output_javascript()
|
||||
{
|
||||
if (function_exists('ob_gzhandler'))
|
||||
{
|
||||
|
@ -11718,7 +11718,7 @@ class SimplePie_IRI
|
|||
* @param string $relative Relative IRI
|
||||
* @return SimplePie_IRI
|
||||
*/
|
||||
function absolutize($base, $relative)
|
||||
static function absolutize($base, $relative)
|
||||
{
|
||||
$relative = (string) $relative;
|
||||
if ($relative !== '')
|
||||
|
@ -12366,7 +12366,7 @@ class SimplePie_Net_IPv6
|
|||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function removeNetmaskSpec($ip)
|
||||
static function removeNetmaskSpec($ip)
|
||||
{
|
||||
if (strpos($ip, '/') !== false)
|
||||
{
|
||||
|
@ -12394,7 +12394,7 @@ class SimplePie_Net_IPv6
|
|||
* @param string $ip a valid IPv6-address (hex format)
|
||||
* @return string the uncompressed IPv6-address (hex format)
|
||||
*/
|
||||
function Uncompress($ip)
|
||||
static function Uncompress($ip)
|
||||
{
|
||||
$uip = SimplePie_Net_IPv6::removeNetmaskSpec($ip);
|
||||
$c1 = -1;
|
||||
|
@ -12480,7 +12480,7 @@ class SimplePie_Net_IPv6
|
|||
* @param string $ip a valid IPv6-address (hex format)
|
||||
* @return array [0] contains the IPv6 part, [1] the IPv4 part (hex format)
|
||||
*/
|
||||
function SplitV64($ip)
|
||||
static function SplitV64($ip)
|
||||
{
|
||||
$ip = SimplePie_Net_IPv6::Uncompress($ip);
|
||||
if (strstr($ip, '.'))
|
||||
|
@ -12506,7 +12506,7 @@ class SimplePie_Net_IPv6
|
|||
* @param string $ip a valid IPv6-address
|
||||
* @return bool true if $ip is an IPv6 address
|
||||
*/
|
||||
function checkIPv6($ip)
|
||||
static function checkIPv6($ip)
|
||||
{
|
||||
$ipPart = SimplePie_Net_IPv6::SplitV64($ip);
|
||||
$count = 0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--- simplepie.php.orig 2014-11-01 15:22:44.047223926 +0300
|
||||
+++ simplepie.php 2014-11-01 15:23:39.571225438 +0300
|
||||
--- simplepie.php.orig 2014-11-01 16:24:27.412577890 +0300
|
||||
+++ simplepie.php 2014-11-01 16:29:06.248585480 +0300
|
||||
@@ -43,6 +43,10 @@
|
||||
* @todo phpDoc comments
|
||||
*/
|
||||
|
@ -262,6 +262,24 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -3049,7 +3066,7 @@ class SimplePie
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
- function sort_items($a, $b)
|
||||
+ static function sort_items($a, $b)
|
||||
{
|
||||
return $a->get_date('U') <= $b->get_date('U');
|
||||
}
|
||||
@@ -3057,7 +3074,7 @@ class SimplePie
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
- function merge_items($urls, $start = 0, $end = 0, $limit = 0)
|
||||
+ static function merge_items($urls, $start = 0, $end = 0, $limit = 0)
|
||||
{
|
||||
if (is_array($urls) && sizeof($urls) > 0)
|
||||
{
|
||||
@@ -3345,7 +3362,7 @@ class SimplePie_Item
|
||||
{
|
||||
$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
|
||||
|
@ -888,6 +906,58 @@
|
|||
switch ($location_iri->get_scheme())
|
||||
{
|
||||
case 'mysql':
|
||||
@@ -9081,7 +9111,7 @@ class SimplePie_Cache_MySQL extends Simp
|
||||
|
||||
class SimplePie_Misc
|
||||
{
|
||||
- function time_hms($seconds)
|
||||
+ static function time_hms($seconds)
|
||||
{
|
||||
$time = '';
|
||||
|
||||
@@ -9109,13 +9139,13 @@ class SimplePie_Misc
|
||||
return $time;
|
||||
}
|
||||
|
||||
- function absolutize_url($relative, $base)
|
||||
+ static function absolutize_url($relative, $base)
|
||||
{
|
||||
$iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);
|
||||
return $iri->get_iri();
|
||||
}
|
||||
|
||||
- function remove_dot_segments($input)
|
||||
+ static function remove_dot_segments($input)
|
||||
{
|
||||
$output = '';
|
||||
while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')
|
||||
@@ -9169,7 +9199,7 @@ class SimplePie_Misc
|
||||
return $output . $input;
|
||||
}
|
||||
|
||||
- function get_element($realname, $string)
|
||||
+ static function get_element($realname, $string)
|
||||
{
|
||||
$return = array();
|
||||
$name = preg_quote($realname, '/');
|
||||
@@ -9206,7 +9236,7 @@ class SimplePie_Misc
|
||||
return $return;
|
||||
}
|
||||
|
||||
- function element_implode($element)
|
||||
+ static function element_implode($element)
|
||||
{
|
||||
$full = "<$element[tag]";
|
||||
foreach ($element['attribs'] as $key => $value)
|
||||
@@ -9225,7 +9255,7 @@ class SimplePie_Misc
|
||||
return $full;
|
||||
}
|
||||
|
||||
- function error($message, $level, $file, $line)
|
||||
+ static function error($message, $level, $file, $line)
|
||||
{
|
||||
if ((ini_get('error_reporting') & $level) > 0)
|
||||
{
|
||||
@@ -9271,7 +9301,7 @@ class SimplePie_Misc
|
||||
* @param str $cache_name_function Obsolete. Exists for backwards
|
||||
* compatibility reasons only.
|
||||
|
@ -897,42 +967,253 @@
|
|||
{
|
||||
$cache = call_user_func(array($cache_class, 'create'), $cache_location, $identifier_url, $cache_extension);
|
||||
|
||||
@@ -9327,7 +9357,7 @@ class SimplePie_Misc
|
||||
@@ -9293,7 +9323,7 @@ class SimplePie_Misc
|
||||
die('Cached file for ' . $identifier_url . ' cannot be found.');
|
||||
}
|
||||
|
||||
function parse_url($url)
|
||||
- function fix_protocol($url, $http = 1)
|
||||
+ static function fix_protocol($url, $http = 1)
|
||||
{
|
||||
$url = SimplePie_Misc::normalize_url($url);
|
||||
$parsed = SimplePie_Misc::parse_url($url);
|
||||
@@ -9325,9 +9355,9 @@ class SimplePie_Misc
|
||||
}
|
||||
}
|
||||
|
||||
- function parse_url($url)
|
||||
+ static function parse_url($url)
|
||||
{
|
||||
- $iri =& new SimplePie_IRI($url);
|
||||
+ $iri = new SimplePie_IRI($url);
|
||||
return array(
|
||||
'scheme' => (string) $iri->get_scheme(),
|
||||
'authority' => (string) $iri->get_authority(),
|
||||
@@ -9339,7 +9369,7 @@ class SimplePie_Misc
|
||||
@@ -9337,9 +9367,9 @@ class SimplePie_Misc
|
||||
);
|
||||
}
|
||||
|
||||
function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
|
||||
- function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
|
||||
+ static function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
|
||||
{
|
||||
- $iri =& new SimplePie_IRI('');
|
||||
+ $iri = new SimplePie_IRI('');
|
||||
$iri->set_scheme($scheme);
|
||||
$iri->set_authority($authority);
|
||||
$iri->set_path($path);
|
||||
@@ -9350,7 +9380,7 @@ class SimplePie_Misc
|
||||
@@ -9348,13 +9378,13 @@ class SimplePie_Misc
|
||||
return $iri->get_iri();
|
||||
}
|
||||
|
||||
function normalize_url($url)
|
||||
- function normalize_url($url)
|
||||
+ static function normalize_url($url)
|
||||
{
|
||||
- $iri =& new SimplePie_IRI($url);
|
||||
+ $iri = new SimplePie_IRI($url);
|
||||
return $iri->get_iri();
|
||||
}
|
||||
|
||||
@@ -10870,7 +10900,7 @@ class SimplePie_Misc
|
||||
- function percent_encoding_normalization($match)
|
||||
+ static function percent_encoding_normalization($match)
|
||||
{
|
||||
$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
|
||||
* @param string $str String to remove bad UTF-8 bytes from
|
||||
* @return string UTF-8 string
|
||||
*/
|
||||
function entities_decode($data)
|
||||
- function utf8_bad_replace($str)
|
||||
+ static function utf8_bad_replace($str)
|
||||
{
|
||||
if (function_exists('iconv') && ($return = @iconv('UTF-8', 'UTF-8//IGNORE', $str)))
|
||||
{
|
||||
@@ -9410,14 +9440,14 @@ class SimplePie_Misc
|
||||
* @param string $string Windows-1252 encoded string
|
||||
* @return string UTF-8 encoded string
|
||||
*/
|
||||
- function windows_1252_to_utf8($string)
|
||||
+ static function windows_1252_to_utf8($string)
|
||||
{
|
||||
static $convert_table = array("\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA8" => "\xC2\xA8", "\xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE" => "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" => "\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF");
|
||||
|
||||
return strtr($string, $convert_table);
|
||||
}
|
||||
|
||||
- function change_encoding($data, $input, $output)
|
||||
+ static function change_encoding($data, $input, $output)
|
||||
{
|
||||
$input = SimplePie_Misc::encoding($input);
|
||||
$output = SimplePie_Misc::encoding($output);
|
||||
@@ -9458,7 +9488,7 @@ class SimplePie_Misc
|
||||
}
|
||||
}
|
||||
|
||||
- function encoding($charset)
|
||||
+ static function encoding($charset)
|
||||
{
|
||||
// Normalization from UTS #22
|
||||
switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset)))
|
||||
@@ -10774,7 +10804,7 @@ class SimplePie_Misc
|
||||
}
|
||||
}
|
||||
|
||||
- function get_curl_version()
|
||||
+ static function get_curl_version()
|
||||
{
|
||||
if (is_array($curl = curl_version()))
|
||||
{
|
||||
@@ -10795,7 +10825,7 @@ class SimplePie_Misc
|
||||
return $curl;
|
||||
}
|
||||
|
||||
- function is_subclass_of($class1, $class2)
|
||||
+ static function is_subclass_of($class1, $class2)
|
||||
{
|
||||
if (func_num_args() !== 2)
|
||||
{
|
||||
@@ -10836,7 +10866,7 @@ class SimplePie_Misc
|
||||
* @param string $data Data to strip comments from
|
||||
* @return string Comment stripped string
|
||||
*/
|
||||
- function strip_comments($data)
|
||||
+ static function strip_comments($data)
|
||||
{
|
||||
$output = '';
|
||||
while (($start = strpos($data, '<!--')) !== false)
|
||||
@@ -10854,7 +10884,7 @@ class SimplePie_Misc
|
||||
return $output . $data;
|
||||
}
|
||||
|
||||
- function parse_date($dt)
|
||||
+ static function parse_date($dt)
|
||||
{
|
||||
$parser = SimplePie_Parse_Date::get();
|
||||
return $parser->parse($dt);
|
||||
@@ -10868,9 +10898,9 @@ class SimplePie_Misc
|
||||
* @param string $data Input data
|
||||
* @return string Output data
|
||||
*/
|
||||
- function entities_decode($data)
|
||||
+ static function entities_decode($data)
|
||||
{
|
||||
- $decoder =& new SimplePie_Decode_HTML_Entities($data);
|
||||
+ $decoder = new SimplePie_Decode_HTML_Entities($data);
|
||||
return $decoder->parse();
|
||||
}
|
||||
|
||||
@@ -10881,7 +10911,7 @@ class SimplePie_Misc
|
||||
* @param string $data Data to strip comments from
|
||||
* @return string Comment stripped string
|
||||
*/
|
||||
- function uncomment_rfc822($string)
|
||||
+ static function uncomment_rfc822($string)
|
||||
{
|
||||
$string = (string) $string;
|
||||
$position = 0;
|
||||
@@ -10935,7 +10965,7 @@ class SimplePie_Misc
|
||||
return $output;
|
||||
}
|
||||
|
||||
- function parse_mime($mime)
|
||||
+ static function parse_mime($mime)
|
||||
{
|
||||
if (($pos = strpos($mime, ';')) === false)
|
||||
{
|
||||
@@ -10947,7 +10977,7 @@ class SimplePie_Misc
|
||||
}
|
||||
}
|
||||
|
||||
- function htmlspecialchars_decode($string, $quote_style)
|
||||
+ static function htmlspecialchars_decode($string, $quote_style)
|
||||
{
|
||||
if (function_exists('htmlspecialchars_decode'))
|
||||
{
|
||||
@@ -10959,7 +10989,7 @@ class SimplePie_Misc
|
||||
}
|
||||
}
|
||||
|
||||
- function atom_03_construct_type($attribs)
|
||||
+ static function atom_03_construct_type($attribs)
|
||||
{
|
||||
if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
|
||||
{
|
||||
@@ -10995,7 +11025,7 @@ class SimplePie_Misc
|
||||
}
|
||||
}
|
||||
|
||||
- function atom_10_construct_type($attribs)
|
||||
+ static function atom_10_construct_type($attribs)
|
||||
{
|
||||
if (isset($attribs['']['type']))
|
||||
{
|
||||
@@ -11017,7 +11047,7 @@ class SimplePie_Misc
|
||||
return SIMPLEPIE_CONSTRUCT_TEXT;
|
||||
}
|
||||
|
||||
- function atom_10_content_construct_type($attribs)
|
||||
+ static function atom_10_content_construct_type($attribs)
|
||||
{
|
||||
if (isset($attribs['']['type']))
|
||||
{
|
||||
@@ -11048,12 +11078,12 @@ class SimplePie_Misc
|
||||
}
|
||||
}
|
||||
|
||||
- function is_isegment_nz_nc($string)
|
||||
+ static function is_isegment_nz_nc($string)
|
||||
{
|
||||
return (bool) preg_match('/^([A-Za-z0-9\-._~\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}!$&\'()*+,;=@]|(%[0-9ABCDEF]{2}))+$/u', $string);
|
||||
}
|
||||
|
||||
- function space_seperated_tokens($string)
|
||||
+ static function space_seperated_tokens($string)
|
||||
{
|
||||
$space_characters = "\x20\x09\x0A\x0B\x0C\x0D";
|
||||
$string_length = strlen($string);
|
||||
@@ -11072,7 +11102,7 @@ class SimplePie_Misc
|
||||
return $tokens;
|
||||
}
|
||||
|
||||
- function array_unique($array)
|
||||
+ static function array_unique($array)
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.2', '>='))
|
||||
{
|
||||
@@ -11122,7 +11152,7 @@ class SimplePie_Misc
|
||||
* @param int $codepoint Unicode codepoint
|
||||
* @return string UTF-8 character
|
||||
*/
|
||||
- function codepoint_to_utf8($codepoint)
|
||||
+ static function codepoint_to_utf8($codepoint)
|
||||
{
|
||||
$codepoint = (int) $codepoint;
|
||||
if ($codepoint < 0)
|
||||
@@ -11169,7 +11199,7 @@ class SimplePie_Misc
|
||||
* relative to the beginning of haystack.
|
||||
* @return bool If needle is not found, stripos() will return boolean false.
|
||||
*/
|
||||
- function stripos($haystack, $needle, $offset = 0)
|
||||
+ static function stripos($haystack, $needle, $offset = 0)
|
||||
{
|
||||
if (function_exists('stripos'))
|
||||
{
|
||||
@@ -11206,7 +11236,7 @@ class SimplePie_Misc
|
||||
* @param string $str The input string.
|
||||
* @return array
|
||||
*/
|
||||
- function parse_str($str)
|
||||
+ static function parse_str($str)
|
||||
{
|
||||
$return = array();
|
||||
$str = explode('&', $str);
|
||||
@@ -11234,7 +11264,7 @@ class SimplePie_Misc
|
||||
* @param string $data XML data
|
||||
* @return array Possible encodings
|
||||
*/
|
||||
- function xml_encoding($data)
|
||||
+ static function xml_encoding($data)
|
||||
{
|
||||
// UTF-32 Big Endian BOM
|
||||
if (substr($data, 0, 4) === "\x00\x00\xFE\xFF")
|
||||
@@ -11266,7 +11296,7 @@ class SimplePie_Misc
|
||||
{
|
||||
if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E"))
|
||||
|
@ -978,7 +1259,22 @@
|
|||
if ($parser->parse())
|
||||
{
|
||||
$encoding[] = $parser->encoding;
|
||||
@@ -11693,7 +11723,7 @@ class SimplePie_IRI
|
||||
@@ -11334,7 +11364,7 @@ class SimplePie_Misc
|
||||
return $encoding;
|
||||
}
|
||||
|
||||
- function output_javascript()
|
||||
+ static function output_javascript()
|
||||
{
|
||||
if (function_exists('ob_gzhandler'))
|
||||
{
|
||||
@@ -11688,12 +11718,12 @@ class SimplePie_IRI
|
||||
* @param string $relative Relative IRI
|
||||
* @return SimplePie_IRI
|
||||
*/
|
||||
- function absolutize($base, $relative)
|
||||
+ static function absolutize($base, $relative)
|
||||
{
|
||||
$relative = (string) $relative;
|
||||
if ($relative !== '')
|
||||
{
|
||||
|
@ -1018,6 +1314,42 @@
|
|||
$this->valid[__FUNCTION__] = true;
|
||||
return true;
|
||||
}
|
||||
@@ -12340,7 +12366,7 @@ class SimplePie_Net_IPv6
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
- function removeNetmaskSpec($ip)
|
||||
+ static function removeNetmaskSpec($ip)
|
||||
{
|
||||
if (strpos($ip, '/') !== false)
|
||||
{
|
||||
@@ -12368,7 +12394,7 @@ class SimplePie_Net_IPv6
|
||||
* @param string $ip a valid IPv6-address (hex format)
|
||||
* @return string the uncompressed IPv6-address (hex format)
|
||||
*/
|
||||
- function Uncompress($ip)
|
||||
+ static function Uncompress($ip)
|
||||
{
|
||||
$uip = SimplePie_Net_IPv6::removeNetmaskSpec($ip);
|
||||
$c1 = -1;
|
||||
@@ -12454,7 +12480,7 @@ class SimplePie_Net_IPv6
|
||||
* @param string $ip a valid IPv6-address (hex format)
|
||||
* @return array [0] contains the IPv6 part, [1] the IPv4 part (hex format)
|
||||
*/
|
||||
- function SplitV64($ip)
|
||||
+ static function SplitV64($ip)
|
||||
{
|
||||
$ip = SimplePie_Net_IPv6::Uncompress($ip);
|
||||
if (strstr($ip, '.'))
|
||||
@@ -12480,7 +12506,7 @@ class SimplePie_Net_IPv6
|
||||
* @param string $ip a valid IPv6-address
|
||||
* @return bool true if $ip is an IPv6 address
|
||||
*/
|
||||
- function checkIPv6($ip)
|
||||
+ static function checkIPv6($ip)
|
||||
{
|
||||
$ipPart = SimplePie_Net_IPv6::SplitV64($ip);
|
||||
$count = 0;
|
||||
@@ -13059,7 +13085,7 @@ class SimplePie_Parse_Date
|
||||
static $object;
|
||||
if (!$object)
|
||||
|
|
Loading…
Reference in New Issue