56 $hours = floor($seconds / 3600);
57 $remainder = $seconds % 3600;
63 $minutes = floor($remainder / 60);
64 $seconds = $remainder % 60;
65 if ($minutes < 10 && $hours > 0)
67 $minutes =
'0' . $minutes;
71 $seconds =
'0' . $seconds;
74 $time .= $minutes.
':';
87 return $iri->get_uri();
101 $name = preg_quote($realname,
'/');
102 if (preg_match_all(
"/<($name)" .
SIMPLEPIE_PCRE_HTML_ATTRIBUTE .
"(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE))
104 for ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++)
106 $return[$i][
'tag'] = $realname;
107 $return[$i][
'full'] = $matches[$i][0][0];
108 $return[$i][
'offset'] = $matches[$i][0][1];
109 if (strlen($matches[$i][3][0]) <= 2)
111 $return[$i][
'self_closing'] =
true;
115 $return[$i][
'self_closing'] =
false;
116 $return[$i][
'content'] = $matches[$i][4][0];
118 $return[$i][
'attribs'] = array();
119 if (isset($matches[$i][2][0]) && preg_match_all(
'/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/',
' ' . $matches[$i][2][0] .
' ', $attribs, PREG_SET_ORDER))
121 for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++)
123 if (count($attribs[$j]) === 2)
125 $attribs[$j][2] = $attribs[$j][1];
137 $full =
"<$element[tag]";
138 foreach ($element[
'attribs'] as $key => $value)
140 $key = strtolower($key);
141 $full .=
" $key=\"" . htmlspecialchars($value[
'data']) .
'"';
143 if ($element[
'self_closing'])
149 $full .=
">$element[content]</$element[tag]>";
154 public static function error($message, $level, $file, $line)
156 if ((ini_get(
'error_reporting') & $level) > 0)
164 $note =
'PHP Warning';
167 $note =
'PHP Notice';
170 $note =
'Unknown Error';
175 if (!function_exists(
'error_log'))
180 $log_file = @ini_get(
'error_log');
181 if (!empty($log_file) && (
'syslog' !== $log_file) && !@is_writable($log_file))
188 @error_log(
"$note: $message in $file on line $line", 0);
199 if ($parsed[
'scheme'] !==
'' && $parsed[
'scheme'] !==
'http' && $parsed[
'scheme'] !==
'https')
204 if ($parsed[
'scheme'] ===
'' && $parsed[
'authority'] ===
'' && !file_exists($url))
209 if ($http === 2 && $parsed[
'scheme'] !==
'')
213 elseif ($http === 3 && strtolower($parsed[
'scheme']) ===
'http')
215 return substr_replace($url,
'podcast', 0, 4);
217 elseif ($http === 4 && strtolower($parsed[
'scheme']) ===
'http')
219 return substr_replace($url,
'itpc', 0, 4);
231 'scheme' => (
string) $iri->scheme,
232 'authority' => (
string) $iri->authority,
233 'path' => (
string) $iri->path,
234 'query' => (
string) $iri->query,
235 'fragment' => (
string) $iri->fragment
239 public static function compress_parse_url($scheme =
'', $authority =
'', $path =
'', $query =
'', $fragment =
'')
242 $iri->scheme = $scheme;
243 $iri->authority = $authority;
245 $iri->query = $query;
246 $iri->fragment = $fragment;
247 return $iri->get_uri();
253 return $iri->get_uri();
258 $integer = hexdec($match[1]);
259 if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E)
261 return chr($integer);
265 return strtoupper($match[0]);
278 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");
280 return strtr($string, $convert_table);
297 if ($input ===
'US-ASCII')
299 static $non_ascii_octects =
'';
300 if (!$non_ascii_octects)
302 for ($i = 0x80; $i <= 0xFF; $i++)
304 $non_ascii_octects .= chr($i);
307 $data = substr($data, 0, strcspn($data, $non_ascii_octects));
311 if ($input ===
'windows-1252' && $output ===
'UTF-8')
334 if ($input ===
'windows-949')
338 if ($output ===
'windows-949')
342 if ($input ===
'Windows-31J')
346 if ($output ===
'Windows-31J')
352 if (@mb_convert_encoding(
"\x80",
'UTF-16BE', $input) ===
"\x00\x80")
356 if (!in_array($input, mb_list_encodings()))
362 if ($return = @mb_convert_encoding($data, $output, $input))
372 return @iconv($input, $output, $data);
389 switch (strtolower(preg_replace(
'/(?:[^a-zA-Z0-9]+|([^0-9])0+)/',
'\1', $charset)))
391 case 'adobestandardencoding':
392 case 'csadobestandardencoding':
393 return 'Adobe-Standard-Encoding';
395 case 'adobesymbolencoding':
397 return 'Adobe-Symbol-Encoding';
403 case 'ansix31101983':
405 case 'csiso99naplps':
408 return 'ANSI_X3.110-1983';
412 case 'csiso89asmo449':
433 case 'csiso4unitedkingdom':
441 case 'csiso47bsviewdata':
443 return 'BS_viewdata';
451 case 'csaz243419851':
452 case 'csiso121canadian1':
455 return 'CSA_Z243.4-1985-1';
458 case 'csaz243419852':
459 case 'csiso122canadian2':
462 return 'CSA_Z243.4-1985-2';
464 case 'csaz24341985gr':
465 case 'csiso123csaz24341985gr':
467 return 'CSA_Z243.4-1985-gr';
469 case 'csiso139csn369103':
479 case 'csiso21german':
490 case 'csiso646danish':
496 case 'csibmebcdicatde':
498 return 'EBCDIC-AT-DE';
500 case 'csebcdicatdea':
502 return 'EBCDIC-AT-DE-A';
506 return 'EBCDIC-CA-FR';
510 return 'EBCDIC-DK-NO';
512 case 'csebcdicdknoa':
514 return 'EBCDIC-DK-NO-A';
522 return 'EBCDIC-ES-A';
526 return 'EBCDIC-ES-S';
530 return 'EBCDIC-FI-SE';
532 case 'csebcdicfisea':
534 return 'EBCDIC-FI-SE-A';
556 case 'csiso111ecmacyrillic':
560 return 'ECMA-cyrillic';
562 case 'csiso17spanish':
568 case 'csiso85spanish2':
574 case 'cseucpkdfmtjapanese':
576 case 'extendedunixcodepackedformatforjapanese':
579 case 'cseucfixwidjapanese':
580 case 'extendedunixcodefixedwidthforjapanese':
581 return 'Extended_UNIX_Code_Fixed_Width_for_Japanese';
589 case 'csiso58gb231280':
599 case 'csiso57gb1988':
605 case 'csiso153gost1976874':
609 return 'GOST_19768-74';
612 case 'csiso150greekccitt':
615 return 'greek-ccitt';
617 case 'csiso88greek7':
622 case 'csiso18greek7old':
654 return 'IBM-Symbols';
761 case 'cspc8codepage437':
773 case 'cspc775baltic':
779 case 'cspc850multilingual':
810 case 'pcmultilingual850euro':
828 case 'cspc862latinhebrew':
870 case 'ebcdiccproece':
883 case 'ebcdiccyrillic':
917 case 'ebcdiclatin9euro':
931 case 'ebcdicus37euro':
937 case 'ebcdicde273euro':
943 case 'ebcdicdk277euro':
944 case 'ebcdicno277euro':
950 case 'ebcdicfi278euro':
951 case 'ebcdicse278euro':
957 case 'ebcdicit280euro':
963 case 'ebcdices284euro':
969 case 'ebcdicgb285euro':
975 case 'ebcdicfr297euro':
981 case 'ebcdicinternational500euro':
987 case 'ebcdicis871euro':
991 case 'csiso143iecp271':
1001 case 'csiso50inis8':
1006 case 'csiso51iniscyrillic':
1007 case 'iniscyrillic':
1009 return 'INIS-cyrillic';
1016 return 'ISO-2022-CN';
1018 case 'iso2022cnext':
1019 return 'ISO-2022-CN-EXT';
1023 return 'ISO-2022-JP';
1025 case 'csiso2022jp2':
1027 return 'ISO-2022-JP-2';
1031 return 'ISO-2022-KR';
1033 case 'cswindows30latin1':
1034 case 'iso88591windows30latin1':
1035 return 'ISO-8859-1-Windows-3.0-Latin-1';
1037 case 'cswindows31latin1':
1038 case 'iso88591windows31latin1':
1039 return 'ISO-8859-1-Windows-3.1-Latin-1';
1043 case 'iso885921987':
1047 return 'ISO-8859-2';
1049 case 'cswindows31latin2':
1050 case 'iso88592windowslatin2':
1051 return 'ISO-8859-2-Windows-Latin-2';
1055 case 'iso885931988':
1059 return 'ISO-8859-3';
1063 case 'iso885941988':
1067 return 'ISO-8859-4';
1069 case 'csisolatincyrillic':
1072 case 'iso885951988':
1074 return 'ISO-8859-5';
1078 case 'csisolatinarabic':
1081 case 'iso885961987':
1083 return 'ISO-8859-6';
1087 return 'ISO-8859-6-E';
1091 return 'ISO-8859-6-I';
1093 case 'csisolatingreek':
1099 case 'iso885971987':
1101 return 'ISO-8859-7';
1103 case 'csisolatinhebrew':
1106 case 'iso885981988':
1108 return 'ISO-8859-8';
1112 return 'ISO-8859-8-E';
1116 return 'ISO-8859-8-I';
1118 case 'cswindows31latin5':
1119 case 'iso88599windowslatin5':
1120 return 'ISO-8859-9-Windows-Latin-5';
1124 case 'iso8859101992':
1128 return 'ISO-8859-10';
1131 return 'ISO-8859-13';
1134 case 'iso8859141998':
1139 return 'ISO-8859-14';
1143 return 'ISO-8859-15';
1146 case 'iso8859162001':
1150 return 'ISO-8859-16';
1153 return 'ISO-10646-J-1';
1156 case 'iso10646ucs2':
1157 return 'ISO-10646-UCS-2';
1160 case 'iso10646ucs4':
1161 return 'ISO-10646-UCS-4';
1163 case 'csunicodeascii':
1164 case 'iso10646ucsbasic':
1165 return 'ISO-10646-UCS-Basic';
1167 case 'csunicodelatin1':
1169 case 'iso10646unicodelatin1':
1170 return 'ISO-10646-Unicode-Latin1';
1172 case 'csiso10646utf1':
1173 case 'iso10646utf1':
1174 return 'ISO-10646-UTF-1';
1179 return 'ISO-11548-1';
1185 case 'csunicodeibm1261':
1186 case 'isounicodeibm1261':
1187 return 'ISO-Unicode-IBM-1261';
1189 case 'csunicodeibm1264':
1190 case 'isounicodeibm1264':
1191 return 'ISO-Unicode-IBM-1264';
1193 case 'csunicodeibm1265':
1194 case 'isounicodeibm1265':
1195 return 'ISO-Unicode-IBM-1265';
1197 case 'csunicodeibm1268':
1198 case 'isounicodeibm1268':
1199 return 'ISO-Unicode-IBM-1268';
1201 case 'csunicodeibm1276':
1202 case 'isounicodeibm1276':
1203 return 'ISO-Unicode-IBM-1276';
1205 case 'csiso646basic1983':
1206 case 'iso646basic1983':
1208 return 'ISO_646.basic:1983';
1210 case 'csiso2intlrefversion':
1212 case 'iso646irv1983':
1214 return 'ISO_646.irv:1983';
1220 return 'ISO_2033-1983';
1222 case 'csiso5427cyrillic':
1227 case 'iso5427cyrillic1981':
1230 return 'ISO_5427:1981';
1232 case 'csiso5428greek':
1235 return 'ISO_5428:1980';
1237 case 'csiso6937add':
1240 return 'ISO_6937-2-25';
1242 case 'csisotextcomm':
1245 return 'ISO_6937-2-add';
1247 case 'csiso8859supp':
1251 return 'ISO_8859-supp';
1253 case 'csiso10367box':
1256 return 'ISO_10367-box';
1258 case 'csiso15italian':
1264 case 'csiso13jisc6220jp':
1266 case 'jisc62201969':
1267 case 'jisc62201969jp':
1270 return 'JIS_C6220-1969-jp';
1272 case 'csiso14jisc6220ro':
1275 case 'jisc62201969ro':
1277 return 'JIS_C6220-1969-ro';
1279 case 'csiso42jisc62261978':
1281 case 'jisc62261978':
1282 return 'JIS_C6226-1978';
1284 case 'csiso87jisx208':
1286 case 'jisc62261983':
1289 return 'JIS_C6226-1983';
1291 case 'csiso91jisc62291984a':
1293 case 'jisc62291984a':
1295 return 'JIS_C6229-1984-a';
1297 case 'csiso92jisc62991984b':
1298 case 'iso646jpocrb':
1300 case 'jisc62291984b':
1302 return 'JIS_C6229-1984-b';
1304 case 'csiso93jis62291984badd':
1306 case 'jisc62291984badd':
1308 return 'JIS_C6229-1984-b-add';
1310 case 'csiso94jis62291984hand':
1312 case 'jisc62291984hand':
1314 return 'JIS_C6229-1984-hand';
1316 case 'csiso95jis62291984handadd':
1318 case 'jisc62291984handadd':
1319 case 'jpocrhandadd':
1320 return 'JIS_C6229-1984-hand-add';
1322 case 'csiso96jisc62291984kana':
1324 case 'jisc62291984kana':
1325 return 'JIS_C6229-1984-kana';
1327 case 'csjisencoding':
1329 return 'JIS_Encoding';
1331 case 'cshalfwidthkatakana':
1336 case 'csiso159jisx2121990':
1340 return 'JIS_X0212-1990';
1342 case 'csiso141jusib1002':
1348 return 'JUS_I.B1.002';
1350 case 'csiso147macedonian':
1352 case 'jusib1003mac':
1354 return 'JUS_I.B1.003-mac';
1356 case 'csiso146serbian':
1358 case 'jusib1003serb':
1360 return 'JUS_I.B1.003-serb';
1362 case 'koi7switched':
1363 return 'KOI7-switched';
1380 case 'strk10482002':
1383 case 'csiso19latingreek':
1386 return 'latin-greek';
1388 case 'csiso27latingreek1':
1391 return 'Latin-greek-1';
1404 case 'csmicrosoftpublishing':
1405 case 'microsoftpublishing':
1406 return 'Microsoft-Publishing';
1416 case 'csiso86hungarian':
1421 return 'MSZ_7795.3';
1428 case 'csnatsdanoadd':
1431 return 'NATS-DANO-ADD';
1438 case 'csnatssefiadd':
1441 return 'NATS-SEFI-ADD';
1443 case 'csiso151cuba':
1448 return 'NC_NC00-10:81';
1450 case 'csiso69french':
1455 return 'NF_Z_62-010';
1457 case 'csiso25french':
1460 case 'nfz620101973':
1461 return 'NF_Z_62-010_(1973)';
1463 case 'csiso60danishnorwegian':
1464 case 'csiso60norwegian1':
1471 case 'csiso61norwegian2':
1478 case 'osdebcdicdf3irv':
1479 return 'OSD_EBCDIC_DF03_IRV';
1481 case 'osdebcdicdf41':
1482 return 'OSD_EBCDIC_DF04_1';
1484 case 'osdebcdicdf415':
1485 return 'OSD_EBCDIC_DF04_15';
1487 case 'cspc8danishnorwegian':
1488 case 'pc8danishnorwegian':
1489 return 'PC8-Danish-Norwegian';
1491 case 'cspc8turkish':
1493 return 'PC8-Turkish';
1495 case 'csiso16portuguese':
1501 case 'csiso84portuguese2':
1509 case 'cyrillicasian':
1517 case 'csiso10swedish':
1524 return 'SEN_850200_B';
1526 case 'csiso11swedishfornames':
1531 return 'SEN_850200_C';
1533 case 'csiso102t617bit':
1538 case 'csiso103t618bit':
1544 case 'csiso128t101g2':
1555 return 'UNICODE-1-1';
1557 case 'csunicode11utf7':
1558 case 'unicode11utf7':
1559 return 'UNICODE-1-1-UTF-7';
1561 case 'csunknown8bit':
1563 return 'UNKNOWN-8BIT';
1571 case 'iso646irv1991':
1606 case 'csventurainternational':
1607 case 'venturainternational':
1608 return 'Ventura-International';
1610 case 'csventuramath':
1612 return 'Ventura-Math';
1616 return 'Ventura-US';
1618 case 'csiso70videotexsupp1':
1620 case 'videotexsuppl':
1621 return 'videotex-suppl';
1632 case 'cswindows31j':
1636 return 'Windows-31J';
1640 return 'windows-874';
1643 case 'csksc56011987':
1651 return 'windows-949';
1654 return 'windows-1250';
1657 return 'windows-1251';
1663 case 'iso885911987':
1668 return 'windows-1252';
1671 return 'windows-1253';
1675 case 'iso885991989':
1680 return 'windows-1254';
1683 return 'windows-1255';
1686 return 'windows-1256';
1689 return 'windows-1257';
1692 return 'windows-1258';
1701 if (is_array($curl = curl_version()))
1703 $curl = $curl[
'version'];
1705 elseif (substr($curl, 0, 5) ===
'curl/')
1707 $curl = substr($curl, 5, strcspn($curl,
"\x09\x0A\x0B\x0C\x0D", 5));
1709 elseif (substr($curl, 0, 8) ===
'libcurl/')
1711 $curl = substr($curl, 8, strcspn($curl,
"\x09\x0A\x0B\x0C\x0D", 8));
1729 while (($start = strpos($data,
'<!--')) !==
false)
1731 $output .= substr($data, 0, $start);
1732 if (($end = strpos($data,
'-->', $start)) !==
false)
1734 $data = substr_replace($data,
'', 0, $end + 3);
1741 return $output . $data;
1747 return $parser->parse($dt);
1760 return $decoder->parse();
1771 $string = (string) $string;
1773 $length = strlen($string);
1778 while ($position < $length && ($pos = strpos($string,
'(', $position)) !==
false)
1780 $output .= substr($string, $position, $pos - $position);
1781 $position = $pos + 1;
1782 if ($string[$pos - 1] !==
'\\')
1785 while ($depth && $position < $length)
1787 $position += strcspn($string,
'()', $position);
1788 if ($string[$position - 1] ===
'\\')
1793 elseif (isset($string[$position]))
1795 switch ($string[$position])
1818 $output .= substr($string, $position);
1825 if (($pos = strpos($mime,
';')) ===
false)
1831 return trim(substr($mime, 0, $pos));
1837 if (isset($attribs[
''][
'mode']) && strtolower(trim($attribs[
''][
'mode']) ===
'base64'))
1845 if (isset($attribs[
''][
'type']))
1847 switch (strtolower(trim($attribs[
''][
'type'])))
1858 case 'application/xhtml+xml':
1873 if (isset($attribs[
''][
'type']))
1875 switch (strtolower(trim($attribs[
''][
'type'])))
1895 if (isset($attribs[
''][
'type']))
1897 $type = strtolower(trim($attribs[
''][
'type']));
1909 if (in_array(substr($type, -4), array(
'+xml',
'/xml')) || substr($type, 0, 5) ===
'text/')
1926 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);
1931 $space_characters =
"\x20\x09\x0A\x0B\x0C\x0D";
1932 $string_length = strlen($string);
1934 $position = strspn($string, $space_characters);
1937 while ($position < $string_length)
1939 $len = strcspn($string, $space_characters, $position);
1940 $tokens[] = substr($string, $position, $len);
1942 $position += strspn($string, $space_characters, $position);
1957 $codepoint = (int) $codepoint;
1962 else if ($codepoint <= 0x7f)
1964 return chr($codepoint);
1966 else if ($codepoint <= 0x7ff)
1968 return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
1970 else if ($codepoint <= 0xffff)
1972 return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
1974 else if ($codepoint <= 0x10ffff)
1976 return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
1981 return "\xEF\xBF\xBD";
1998 $str = explode(
'&', $str);
2000 foreach ($str as $section)
2002 if (strpos($section,
'=') !==
false)
2004 list($name, $value) = explode(
'=', $section, 2);
2005 $return[urldecode($name)][] = urldecode($value);
2009 $return[urldecode($section)][] = null;
2027 if (substr($data, 0, 4) ===
"\x00\x00\xFE\xFF")
2029 $encoding[] =
'UTF-32BE';
2032 elseif (substr($data, 0, 4) ===
"\xFF\xFE\x00\x00")
2034 $encoding[] =
'UTF-32LE';
2037 elseif (substr($data, 0, 2) ===
"\xFE\xFF")
2039 $encoding[] =
'UTF-16BE';
2042 elseif (substr($data, 0, 2) ===
"\xFF\xFE")
2044 $encoding[] =
'UTF-16LE';
2047 elseif (substr($data, 0, 3) ===
"\xEF\xBB\xBF")
2049 $encoding[] =
'UTF-8';
2052 elseif (substr($data, 0, 20) ===
"\x00\x00\x00\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C")
2054 if ($pos = strpos($data,
"\x00\x00\x00\x3F\x00\x00\x00\x3E"))
2057 if ($parser->parse())
2059 $encoding[] = $parser->encoding;
2062 $encoding[] =
'UTF-32BE';
2065 elseif (substr($data, 0, 20) ===
"\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C\x00\x00\x00")
2067 if ($pos = strpos($data,
"\x3F\x00\x00\x00\x3E\x00\x00\x00"))
2070 if ($parser->parse())
2072 $encoding[] = $parser->encoding;
2075 $encoding[] =
'UTF-32LE';
2078 elseif (substr($data, 0, 10) ===
"\x00\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C")
2080 if ($pos = strpos($data,
"\x00\x3F\x00\x3E"))
2083 if ($parser->parse())
2085 $encoding[] = $parser->encoding;
2088 $encoding[] =
'UTF-16BE';
2091 elseif (substr($data, 0, 10) ===
"\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C\x00")
2093 if ($pos = strpos($data,
"\x3F\x00\x3E\x00"))
2096 if ($parser->parse())
2098 $encoding[] = $parser->encoding;
2101 $encoding[] =
'UTF-16LE';
2104 elseif (substr($data, 0, 5) ===
"\x3C\x3F\x78\x6D\x6C")
2106 if ($pos = strpos($data,
"\x3F\x3E"))
2108 $parser = $registry->create(
'XML_Declaration_Parser', array(substr($data, 5, $pos - 5)));
2109 if ($parser->parse())
2111 $encoding[] = $parser->encoding;
2114 $encoding[] =
'UTF-8';
2119 $encoding[] =
'UTF-8';
2126 if (function_exists(
'ob_gzhandler'))
2128 ob_start(
'ob_gzhandler');
2130 header(
'Content-type: text/javascript; charset: UTF-8');
2131 header(
'Cache-Control: must-revalidate');
2132 header(
'Expires: ' . gmdate(
'D, d M Y H:i:s', time() + 604800) .
' GMT');
2134 function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
2135 if (placeholder !=
'') {
2136 document.writeln(
'<embed type="'+type+
'" style="cursor:hand; cursor:pointer;" href="'+link+
'" src="'+placeholder+
'" width="'+width+
'" height="'+height+
'" autoplay="false" target="myself" controller="false" loop="'+loop+
'" scale="aspect" bgcolor="'+bgcolor+
'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
2139 document.writeln(
'<embed type="'+type+
'" style="cursor:hand; cursor:pointer;" src="'+link+
'" width="'+width+
'" height="'+height+
'" autoplay="false" target="myself" controller="true" loop="'+loop+
'" scale="aspect" bgcolor="'+bgcolor+
'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
2143 function embed_flash(bgcolor, width, height, link, loop, type) {
2144 document.writeln(
'<embed src="'+link+
'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="'+type+
'" quality="high" width="'+width+
'" height="'+height+
'" bgcolor="'+bgcolor+
'" loop="'+loop+
'"></embed>');
2147 function embed_flv(width, height, link, placeholder, loop, player) {
2148 document.writeln(
'<embed src="'+player+
'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="'+width+
'" height="'+height+
'" wmode="transparent" flashvars="file='+link+
'&autostart=false&repeat='+loop+
'&showdigits=true&showfsbutton=false"></embed>');
2151 function embed_wmedia(width, height, link) {
2152 document.writeln(
'<embed type="application/x-mplayer2" src="'+link+
'" autosize="1" width="'+width+
'" height="'+height+
'" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>');
2165 $root = dirname(dirname(__FILE__));
2166 if (file_exists($root .
'/.git/index'))
2168 return filemtime($root .
'/.git/index');
2170 elseif (file_exists($root .
'/SimplePie'))
2173 foreach (glob($root .
'/SimplePie/*.php') as $file)
2175 if (($mtime = filemtime($file)) > $time)
2182 elseif (file_exists(dirname(__FILE__) .
'/Core.php'))
2184 return filemtime(dirname(__FILE__) .
'/Core.php');
2188 return filemtime(__FILE__);
2198 $info .=
'PHP ' . PHP_VERSION .
"\n";
2199 if ($sp->error() !== null)
2201 $info .=
'Error occurred: ' . $sp->error() .
"\n";
2205 $info .=
"No error found.\n";
2207 $info .=
"Extensions:\n";
2208 $extensions = array(
'pcre',
'curl',
'zlib',
'mbstring',
'iconv',
'xmlreader',
'xml');
2209 foreach ($extensions as $ext)
2211 if (extension_loaded($ext))
2213 $info .=
" $ext loaded\n";
2217 $info .=
' Version ' . PCRE_VERSION .
"\n";
2220 $version = curl_version();
2221 $info .=
' Version ' . $version[
'version'] .
"\n";
2224 $info .=
' Overloading: ' . mb_get_info(
'func_overload') .
"\n";
2227 $info .=
' Version ' . ICONV_VERSION .
"\n";
2230 $info .=
' Version ' . LIBXML_DOTTED_VERSION .
"\n";
2236 $info .=
" $ext not loaded\n";