| | |
| | | |
| | | header("Expires: ".gmdate("D, d M Y H:i:s")." GMT"); |
| | | header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
| | | header("Cache-Control: private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); |
| | | header("Cache-Control: private, must-revalidate, post-check=0, pre-check=0"); |
| | | header("Pragma: no-cache"); |
| | | |
| | | // We need to set the following headers to make downloads work using IE in HTTPS mode. |
| | |
| | | return $brackets{0} . implode(',', $pairs) . $brackets{1}; |
| | | } |
| | | } |
| | | else if (is_numeric($var) && strval(intval($var)) === strval($var)) |
| | | else if (!is_string($var) && strval(intval($var)) === strval($var)) |
| | | return $var; |
| | | else if (is_bool($var)) |
| | | return $var ? '1' : '0'; |
| | |
| | | */ |
| | | function in_array_nocase($needle, $haystack) |
| | | { |
| | | $needle = rc_strtolower($needle); |
| | | foreach ($haystack as $value) |
| | | if (strtolower($needle)===strtolower($value)) |
| | | if ($needle===rc_strtolower($value)) |
| | | return true; |
| | | |
| | | return false; |
| | |
| | | // FIXME: the order is important, because sometimes |
| | | // iso string is detected as euc-jp and etc. |
| | | $enc = array( |
| | | 'SJIS', 'BIG5', 'GB2312', 'UTF-8', |
| | | 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', |
| | | 'ISO-8859-5', 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9', |
| | | 'ISO-8859-10', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16', |
| | | 'WINDOWS-1252', 'WINDOWS-1251', 'EUC-JP', 'EUC-TW', 'KOI8-R', |
| | | 'ISO-2022-KR', 'ISO-2022-JP' |
| | | 'UTF-8', 'SJIS', 'BIG5', 'GB2312', |
| | | 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', |
| | | 'ISO-8859-5', 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9', |
| | | 'ISO-8859-10', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16', |
| | | 'WINDOWS-1252', 'WINDOWS-1251', 'EUC-JP', 'EUC-TW', 'KOI8-R', |
| | | 'ISO-2022-KR', 'ISO-2022-JP' |
| | | ); |
| | | |
| | | $result = mb_detect_encoding($string, join(',', $enc)); |