| | |
| | | return $return; |
| | | } |
| | | |
| | | function element_implode($element) |
| | | static function element_implode($element) |
| | | { |
| | | $full = "<$element[tag]"; |
| | | foreach ($element['attribs'] as $key => $value) |
| | |
| | | die('Cached file for ' . $identifier_url . ' cannot be found.'); |
| | | } |
| | | |
| | | function fix_protocol($url, $http = 1) |
| | | public static function fix_protocol($url, $http = 1) |
| | | { |
| | | $url = SimplePie_Misc::normalize_url($url); |
| | | $parsed = SimplePie_Misc::parse_url($url); |
| | |
| | | } |
| | | } |
| | | |
| | | function parse_url($url) |
| | | public static function parse_url($url) |
| | | { |
| | | $iri = new SimplePie_IRI($url); |
| | | return array( |
| | |
| | | return $iri->get_iri(); |
| | | } |
| | | |
| | | function normalize_url($url) |
| | | public static function normalize_url($url) |
| | | { |
| | | $iri = new SimplePie_IRI($url); |
| | | return $iri->get_iri(); |
| | |
| | | return strtr($string, $convert_table); |
| | | } |
| | | |
| | | function change_encoding($data, $input, $output) |
| | | public static function change_encoding($data, $input, $output) |
| | | { |
| | | $input = SimplePie_Misc::encoding($input); |
| | | $output = SimplePie_Misc::encoding($output); |
| | |
| | | } |
| | | } |
| | | |
| | | function encoding($charset) |
| | | public static function encoding($charset) |
| | | { |
| | | // Normalization from UTS #22 |
| | | switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset))) |
| | |
| | | } |
| | | } |
| | | |
| | | function get_curl_version() |
| | | public static function get_curl_version() |
| | | { |
| | | if (is_array($curl = curl_version())) |
| | | { |
| | |
| | | * @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(); |
| | |
| | | * @param string $data XML data |
| | | * @return array Possible encodings |
| | | */ |
| | | function xml_encoding($data) |
| | | public static function xml_encoding($data) |
| | | { |
| | | // UTF-32 Big Endian BOM |
| | | if (substr($data, 0, 4) === "\x00\x00\xFE\xFF") |