pike.git
/
src
/
modules
/
_Roxen
/
roxen.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/_Roxen/roxen.c:481:
} static void f_html_encode_string( INT32 args ) /*! @decl string html_encode_string(mixed in) *! *! Encodes the @[in] data as an HTML safe string. */ { struct pike_string *str; int newlen;
+
INT32 min;
if( args != 1 ) Pike_error("Wrong number of arguments to html_encode_string\n" ); switch( TYPEOF(Pike_sp[-1]) ) { void o_cast_to_string(); case PIKE_T_INT: case PIKE_T_FLOAT:
pike.git/src/modules/_Roxen/roxen.c:506:
default: o_cast_to_string(); case PIKE_T_STRING: break; } str = Pike_sp[-1].u.string; newlen = str->len;
+
check_string_range(str, 1, &min, NULL);
+
+
if (min > '>') return;
+
#define COUNT(T) { \ T *s = (T *)str->str; \ int i; \ for( i = 0; i<str->len; i++ ) \ switch( s[i] ) \ { \ case 0: /* � */ \ case '<': /* < */ \ case '>': newlen+=3; break;/* > */ \ case '&': /* & */ \