예제 #1
0
파일: SPCommon.php 프로젝트: bilel99/oge
    public static function enforce_safe_char3986($value)
    {
        return $value != rawurlencode($value);
    }
    private static function init3986()
    {
        if (!self::$__first_use) {
            return;
        }
        self::$safe_chars3986 = array_values(array_filter(str_split(self::$safe_chars3986), array("SPUtils", "enforce_safe_char3986")));
        if (count(self::$safe_chars3986) != 0) {
            self::$safe_chars_encoded3986 = array_map("rawurlencode", self::$safe_chars3986);
            self::$__encode_function3986 = array("SPUtils", "rfc3986_encode");
            if (count(self::$safe_chars3986) == 1) {
                self::$safe_chars3986 = current(self::$safe_chars3986);
                self::$safe_chars_encoded3986 = current(self::$safe_chars_encoded3986);
            }
        } else {
            //!< it would appear that rawurlencode in PHP 5.3 returns just what we need
            self::$__encode_function3986 = "rawurlencode";
        }
        self::$encode_callbacks["rfc3986"] = self::$__encode_function3986;
        self::$__first_use = false;
    }
    public static function init()
    {
        self::init3986();
    }
}
SPUtils::init();