: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
return 'OSD_EBCDIC_DF03_IRV';
return 'OSD_EBCDIC_DF04_1';
return 'OSD_EBCDIC_DF04_15';
case 'cspc8danishnorwegian':
case 'pc8danishnorwegian':
return 'PC8-Danish-Norwegian';
case 'csiso16portuguese':
case 'csiso84portuguese2':
case 'csiso11swedishfornames':
return 'UNICODE-1-1-UTF-7';
case 'csventurainternational':
case 'venturainternational':
return 'Ventura-International';
case 'csiso70videotexsupp1':
public static function get_curl_version()
if (is_array($curl = curl_version()))
$curl = $curl['version'];
elseif (substr($curl, 0, 5) === 'curl/')
$curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5));
elseif (substr($curl, 0, 8) === 'libcurl/')
$curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8));
* @param string $data Data to strip comments from
* @return string Comment stripped string
public static function strip_comments($data)
while (($start = strpos($data, '<!--')) !== false)
$output .= substr($data, 0, $start);
if (($end = strpos($data, '-->', $start)) !== false)
$data = substr_replace($data, '', 0, $end + 3);
public static function parse_date($dt)
$parser = SimplePie_Parse_Date::get();
return $parser->parse($dt);
* @deprecated Use DOMDocument instead
* @param string $data Input data
* @return string Output data
public static function entities_decode($data)
$decoder = new SimplePie_Decode_HTML_Entities($data);
return $decoder->parse();
* @param string $data Data to strip comments from
* @return string Comment stripped string
public static function uncomment_rfc822($string)
$string = (string) $string;
$length = strlen($string);
while ($position < $length && ($pos = strpos($string, '(', $position)) !== false)
$output .= substr($string, $position, $pos - $position);
if ($string[$pos - 1] !== '\\')
while ($depth && $position < $length)
$position += strcspn($string, '()', $position);
if ($string[$position - 1] === '\\')
elseif (isset($string[$position]))
switch ($string[$position])
$output .= substr($string, $position);
public static function parse_mime($mime)
if (($pos = strpos($mime, ';')) === false)
return trim(substr($mime, 0, $pos));
public static function atom_03_construct_type($attribs)
if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
$mode = SIMPLEPIE_CONSTRUCT_BASE64;
$mode = SIMPLEPIE_CONSTRUCT_NONE;
if (isset($attribs['']['type']))
switch (strtolower(trim($attribs['']['type'])))
return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
return SIMPLEPIE_CONSTRUCT_HTML | $mode;
case 'application/xhtml+xml':
return SIMPLEPIE_CONSTRUCT_XHTML | $mode;
return SIMPLEPIE_CONSTRUCT_NONE | $mode;
return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
public static function atom_10_construct_type($attribs)
if (isset($attribs['']['type']))
switch (strtolower(trim($attribs['']['type'])))
return SIMPLEPIE_CONSTRUCT_TEXT;
return SIMPLEPIE_CONSTRUCT_HTML;
return SIMPLEPIE_CONSTRUCT_XHTML;
return SIMPLEPIE_CONSTRUCT_NONE;
return SIMPLEPIE_CONSTRUCT_TEXT;
public static function atom_10_content_construct_type($attribs)
if (isset($attribs['']['type']))
$type = strtolower(trim($attribs['']['type']));
return SIMPLEPIE_CONSTRUCT_TEXT;
return SIMPLEPIE_CONSTRUCT_HTML;
return SIMPLEPIE_CONSTRUCT_XHTML;
if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/')
return SIMPLEPIE_CONSTRUCT_NONE;
return SIMPLEPIE_CONSTRUCT_BASE64;
return SIMPLEPIE_CONSTRUCT_TEXT;
public 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);
public static function space_separated_tokens($string)
$space_characters = "\x20\x09\x0A\x0B\x0C\x0D";
$string_length = strlen($string);
$position = strspn($string, $space_characters);
while ($position < $string_length)
$len = strcspn($string, $space_characters, $position);
$tokens[] = substr($string, $position, $len);
$position += strspn($string, $space_characters, $position);
* Converts a unicode codepoint to a UTF-8 character
* @param int $codepoint Unicode codepoint
* @return string UTF-8 character
public static function codepoint_to_utf8($codepoint)
$codepoint = (int) $codepoint;
else if ($codepoint <= 0x7f)
else if ($codepoint <= 0x7ff)
return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
else if ($codepoint <= 0xffff)
return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
else if ($codepoint <= 0x10ffff)
return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
// U+FFFD REPLACEMENT CHARACTER