7 #define lower_hexdigits (ruby_hexdigits+0) 8 #define upper_hexdigits (ruby_hexdigits+16) 9 #define char_to_number(c) ruby_digit36_to_number_table[(unsigned char)(c)] 54 for (i = 0; i <
len; i++) {
101 for (i = 0; i <
len; i++) {
104 if (c !=
'&')
continue;
106 if (++i >= len)
break;
107 c = (
unsigned char)cstr[i];
108 #define MATCH(s) (len - i >= (int)rb_strlen_lit(s) && \ 109 memcmp(&cstr[i], s, rb_strlen_lit(s)) == 0 && \ 110 (i += rb_strlen_lit(s) - 1, 1)) 117 else if (
MATCH(
"mp;")) {
144 if (len - ++i >= 2 &&
ISDIGIT(cstr[i])) {
147 else if ((cstr[i] ==
'x' || cstr[i] ==
'X') && len - ++i >= 2 &&
ISXDIGIT(cstr[i])) {
152 if (overflow || cc >= charlimit || cstr[i] !=
';')
continue;
157 if (charlimit > 256) {
161 c = (
unsigned char)cc;
192 case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
193 case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
194 case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
195 case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
196 case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
197 case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
198 case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
199 case '-':
case '.':
case '_':
210 long i,
len, beg = 0;
218 for (i = 0; i <
len; ++i) {
219 const unsigned char c = (
unsigned char)cstr[i];
252 long i,
len, beg = 0;
261 for (i = 0; i <
len; ++i) {
263 const char c = cstr[i];
266 if (i + 3 > len)
break;
301 if (origenc != encidx) {
static VALUE cgiesc_escape_html(VALUE self, VALUE str)
VALUE rb_cvar_get(VALUE, ID)
static VALUE optimized_escape(VALUE str)
int rb_enc_get_index(VALUE obj)
unsigned int OnigCodePoint
static VALUE optimized_escape_html(VALUE str)
static void preserve_original_state(VALUE orig, VALUE dest)
VALUE rb_str_cat(VALUE, const char *, long)
#define ENC_CODERANGE_SET(obj, cr)
rb_encoding * rb_to_encoding(VALUE enc)
static ID id_accept_charset
int rb_enc_str_coderange(VALUE)
static unsigned char url_unreserved_char(unsigned char c)
VALUE rb_enc_associate(VALUE obj, rb_encoding *enc)
RUBY_EXTERN unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow)
void rb_prepend_module(VALUE klass, VALUE module)
int rb_enc_to_index(rb_encoding *enc)
RUBY_EXTERN VALUE rb_cObject
static VALUE optimized_unescape(VALUE str, VALUE encoding)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
#define ENC_CODERANGE_CLEAN_P(cr)
#define ENC_CODERANGE_UNKNOWN
VALUE rb_enc_associate_index(VALUE obj, int idx)
#define char_to_number(c)
static VALUE cgiesc_unescape(int argc, VALUE *argv, VALUE self)
unsigned char buf[MIME_BUF_SIZE]
#define rb_enc_str_asciicompat_p(str)
void rb_extend_object(VALUE obj, VALUE module)
static void html_escaped_cat(VALUE str, char c)
static VALUE cgiesc_unescape_html(VALUE self, VALUE str)
VALUE rb_call_super(int, const VALUE *)
static VALUE accept_charset(int argc, VALUE *argv, VALUE self)
register unsigned int len
VALUE rb_define_module_under(VALUE outer, const char *name)
rb_encoding * rb_enc_get(VALUE obj)
#define ENC_CODERANGE(obj)
VALUE rb_str_cat_cstr(VALUE, const char *)
static VALUE cgiesc_escape(VALUE self, VALUE str)
static VALUE optimized_unescape_html(VALUE str)
RUBY_EXTERN const signed char ruby_digit36_to_number_table[]
RUBY_EXTERN const char ruby_hexdigits[]
#define rb_intern_const(str)
#define rb_enc_mbcput(c, buf, enc)
VALUE rb_str_buf_new(long)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
#define RB_OBJ_INFECT_RAW(x, s)