cvs: php4 / NEWS /ext/session php_session.h session.c /ext/standard url_scanner_ex.c url_scanner_ex.h url_scanner_ex.re
| From: | Thies C. Arntzen | Date: | Sun, 28 Apr 2002 11:45:46 +0000 |
| Subject: | cvs: php4 / NEWS /ext/session php_session.h session.c /ext/standard url_scanner_ex.c url_scanner_ex.h url_scanner_ex.re | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11497@lists.php.net to get a copy of this message | ||
thies Sun Apr 28 07:45:46 2002 EDT
Modified files:
/php4 NEWS
/php4/ext/session php_session.h session.c
/php4/ext/standard url_scanner_ex.c url_scanner_ex.h
url_scanner_ex.re
Log:
revert session_set_userdata - diffent patch will come shortly
Index: php4/NEWS diff -u php4/NEWS:1.958 php4/NEWS:1.959 --- php4/NEWS:1.958 Sat Apr 27 21:49:42 2002 +++ php4/NEWS Sun Apr 28 07:45:45 2002 @@ -2,9 +2,6 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2002, Version 4.3.0 - If possible set Content-Length header in zlib.output_compression mode. (thies) -- Added session_set_userdata() which enables you to specify one variable that - will be kept in the browser in addition to the session-id. - Note: This only works with trans-sid sessions (no cookie). (thies) - Major update of domxml. New functions and better DOM compliance. (Uwe) - Added large OID value (2^31 to 2^32) support for pg_lo_import(), pg_lo_unlink(), pg_lo_open() and pg_lo_export(). (Yasuo) Index: php4/ext/session/php_session.h diff -u php4/ext/session/php_session.h:1.76 php4/ext/session/php_session.h:1.77 --- php4/ext/session/php_session.h:1.76 Sat Apr 27 10:07:50 2002 +++ php4/ext/session/php_session.h Sun Apr 28 07:45:45 2002 @@ -93,8 +93,6 @@ char *save_path; char *session_name; char *id; - char *udata_name; - char *udata_value; char *extern_referer_chk; char *entropy_file; char *cache_limiter; @@ -143,7 +141,6 @@ PHP_FUNCTION(session_set_cookie_params); PHP_FUNCTION(session_get_cookie_params); PHP_FUNCTION(session_write_close); -PHP_FUNCTION(session_set_userdata); #ifdef ZTS #define PS(v) TSRMG(ps_globals_id, php_ps_globals *, v) Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.298 php4/ext/session/session.c:1.299 --- php4/ext/session/session.c:1.298 Sat Apr 27 10:07:50 2002 +++ php4/ext/session/session.c Sun Apr 28 07:45:45 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.298 2002/04/27 14:07:50 thies Exp $ */ +/* $Id: session.c,v 1.299 2002/04/28 11:45:45 thies Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -71,13 +71,10 @@ PHP_FE(session_set_cookie_params, NULL) PHP_FE(session_get_cookie_params, NULL) PHP_FE(session_write_close, NULL) - PHP_FE(session_set_userdata, NULL) {NULL, NULL, NULL} }; /* }}} */ -#define SAFE_STRING(s) ((s)?(s):"") - ZEND_DECLARE_MODULE_GLOBALS(ps); static ps_module *_php_find_ps_module(char *name TSRMLS_DC); @@ -87,7 +84,7 @@ static void php_session_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) { if ((PS(session_status) == php_session_active)) { - *handled_output = url_adapt_ext_ex(output, output_len, PS(session_name), PS(id), SAFE_STRING(PS(udata_name)), SAFE_STRING(PS(udata_value)), handled_output_len, (zend_bool) (mode&PHP_OUTPUT_HANDLER_END ? 1 : 0) TSRMLS_CC); + *handled_output = url_adapt_ext_ex(output, output_len, PS(session_name), PS(id), handled_output_len, (zend_bool) (mode&PHP_OUTPUT_HANDLER_END ? 1 : 0) TSRMLS_CC); } else { *handled_output = NULL; } @@ -1406,32 +1403,11 @@ } /* }}} */ -/* {{{ proto bool session_set_userdata(string var, string value) - sets one additional variable that will be added by in trans-SID mode */ -PHP_FUNCTION(session_set_userdata) -{ - zval **str; - zval **val; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &str, &val) == FAILURE) - WRONG_PARAM_COUNT; - - if ((Z_TYPE_PP(str) != IS_STRING) || (Z_TYPE_PP(val) != IS_STRING)) { - php_error(E_ERROR,"session_set_userdata expects both parameters to be strings"); - RETURN_FALSE; - } - - PS(udata_name) = estrndup(Z_STRVAL_PP(str), Z_STRLEN_PP(str)); - PS(udata_value) = estrndup(Z_STRVAL_PP(val), Z_STRLEN_PP(val)); - - RETURN_TRUE; -} -/* }}} */ PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newlen TSRMLS_DC) { if (PS(apply_trans_sid) && (PS(session_status) == php_session_active)) { - *new = url_adapt_single_url(url, urllen, PS(session_name), PS(id), PS(udata_name), PS(udata_value), newlen TSRMLS_CC); + *new = url_adapt_single_url(url, urllen, PS(session_name), PS(id), newlen TSRMLS_CC); } } @@ -1454,17 +1430,6 @@ if (PS(id)) { efree(PS(id)); } - - if (PS(udata_name)) { - efree(PS(udata_name)); - PS(udata_name) = NULL; - } - - if (PS(udata_value)) { - efree(PS(udata_value)); - PS(udata_value) = NULL; - } - zend_hash_destroy(&PS(vars)); } Index: php4/ext/standard/url_scanner_ex.c diff -u php4/ext/standard/url_scanner_ex.c:1.56 php4/ext/standard/url_scanner_ex.c:1.57 --- php4/ext/standard/url_scanner_ex.c:1.56 Sun Apr 28 00:14:47 2002 +++ php4/ext/standard/url_scanner_ex.c Sun Apr 28 07:45:45 2002 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.5 on Sat Apr 28 00:00:01 2002 */ +/* Generated by re2c 0.5 on Sun Apr 28 13:43:23 2002 */ #line 1 "/home/thies/devel/php4/ext/standard/url_scanner_ex.re" /* +----------------------------------------------------------------------+ @@ -95,7 +95,7 @@ #define YYLIMIT q #define YYMARKER r -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *name, smart_str *val, smart_str *udata_name, smart_str *udata_value, const char *separator) +static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *name, smart_str *val, const char *separator) { register const char *p, *q; const char *bash = NULL; @@ -188,12 +188,6 @@ smart_str_append(dest, name); smart_str_appendc(dest, '='); smart_str_append(dest, val); - if (udata_name->len && udata_value->len) { - smart_str_appends(dest, separator); - smart_str_append(dest, udata_name); - smart_str_appendc(dest, '='); - smart_str_append(dest, udata_value); - } if (bash) smart_str_appendl(dest, bash, q - bash); @@ -216,7 +210,7 @@ if (quotes) smart_str_appendc(&ctx->result, type); if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->q_name, &ctx->q_value, &ctx->q_udata_name, &ctx->q_udata_value, PG(arg_separator).output); + append_modified_url(&ctx->val, &ctx->result, &ctx->q_name, &ctx->q_value, PG(arg_separator).output); } else { smart_str_append(&ctx->result, &ctx->val); } @@ -256,14 +250,6 @@ smart_str_appends(&ctx->result, "\" value=\""); smart_str_append(&ctx->result, &ctx->q_value); smart_str_appends(&ctx->result, "\" />"); - - if (ctx->q_udata_name.len) { - smart_str_appends(&ctx->result, "<input type=\"hidden\" name=\""); - smart_str_append(&ctx->result, &ctx->q_udata_name); - smart_str_appends(&ctx->result, "\" value=\""); - smart_str_append(&ctx->result, &ctx->q_udata_value); - smart_str_appends(&ctx->result, "\" />"); - } } } @@ -378,17 +364,17 @@ if(yybm[0+yych] & 128) goto yy15; yy13: yych = *++YYCURSOR; yy14: -#line 277 +#line 263 { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } yy15: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy16: if(yybm[0+yych] & 128) goto yy15; yy17: -#line 278 +#line 264 { passthru(STD_ARGS); goto state_plain; } } -#line 279 +#line 265 state_tag: @@ -442,11 +428,11 @@ yy20: yych = *++YYCURSOR; goto yy25; yy21: -#line 284 +#line 270 { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } yy22: yych = *++YYCURSOR; yy23: -#line 285 +#line 271 { passthru(STD_ARGS); goto state_plain_begin; } yy24: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -454,7 +440,7 @@ yy25: if(yybm[0+yych] & 128) goto yy24; goto yy21; } -#line 286 +#line 272 state_next_arg_begin: @@ -525,20 +511,20 @@ } yy28: yych = *++YYCURSOR; yy29: -#line 294 +#line 280 { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } yy30: yych = *++YYCURSOR; goto yy37; yy31: -#line 295 +#line 281 { passthru(STD_ARGS); goto state_next_arg; } yy32: yych = *++YYCURSOR; yy33: -#line 296 +#line 282 { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } yy34: yych = *++YYCURSOR; yy35: -#line 297 +#line 283 { passthru(STD_ARGS); goto state_plain_begin; } yy36: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -546,7 +532,7 @@ yy37: if(yybm[0+yych] & 128) goto yy36; goto yy31; } -#line 298 +#line 284 state_arg: @@ -600,11 +586,11 @@ yy40: yych = *++YYCURSOR; goto yy45; yy41: -#line 303 +#line 289 { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } yy42: yych = *++YYCURSOR; yy43: -#line 304 +#line 290 { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } yy44: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -612,7 +598,7 @@ yy45: if(yybm[0+yych] & 128) goto yy44; goto yy41; } -#line 305 +#line 291 state_before_val: @@ -667,12 +653,12 @@ if(yych == ' ') goto yy55; if(yych == '=') goto yy53; yy49: -#line 311 +#line 297 { --YYCURSOR; goto state_next_arg_begin; } yy50: yych = *++YYCURSOR; goto yy54; yy51: -#line 310 +#line 296 { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } yy52: yych = *++YYCURSOR; goto yy49; @@ -691,7 +677,7 @@ case 0: goto yy49; } } -#line 312 +#line 298 @@ -761,7 +747,7 @@ yych = *(YYMARKER = ++YYCURSOR); if(yych != '>') goto yy74; yy61: -#line 321 +#line 307 { passthru(STD_ARGS); goto state_next_arg_begin; } yy62: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -770,7 +756,7 @@ yy63: yych = *++YYCURSOR; goto yy67; yy64: -#line 320 +#line 306 { handle_val(STD_ARGS, 0, '"'); goto state_next_arg_begin; } yy65: yych = *++YYCURSOR; goto yy61; @@ -790,7 +776,7 @@ } yy71: yych = *++YYCURSOR; yy72: -#line 319 +#line 305 { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } yy73: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -799,10 +785,10 @@ if(yych >= '>') goto yy70; yy75: yych = *++YYCURSOR; yy76: -#line 318 +#line 304 { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } } -#line 322 +#line 308 stop: @@ -816,22 +802,18 @@ } -char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen TSRMLS_DC) +char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) { smart_str surl = {0}; smart_str buf = {0}; smart_str sname = {0}; smart_str sval = {0}; - smart_str aname = {0}; - smart_str avalue = {0}; smart_str_setl(&surl, url, urllen); smart_str_sets(&sname, name); smart_str_sets(&sval, value); - smart_str_sets(&aname, udata_name); - smart_str_sets(&avalue, udata_value); - append_modified_url(&surl, &buf, &sname, &sval, &aname, &avalue, PG(arg_separator).output); + append_modified_url(&surl, &buf, &sname, &sval, PG(arg_separator).output); smart_str_0(&buf); if (newlen) *newlen = buf.len; @@ -839,7 +821,7 @@ return buf.c; } -char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen, zend_bool do_flush TSRMLS_DC) +char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *value, size_t *newlen, zend_bool do_flush TSRMLS_DC) { url_adapt_state_ex_t *ctx; char *retval; @@ -848,10 +830,6 @@ smart_str_sets(&ctx->q_name, name); smart_str_sets(&ctx->q_value, value); - - smart_str_sets(&ctx->q_udata_name, udata_name); - smart_str_sets(&ctx->q_udata_value, udata_value); - xx_mainloop(ctx, src, srclen TSRMLS_CC); *newlen = ctx->result.len; Index: php4/ext/standard/url_scanner_ex.h diff -u php4/ext/standard/url_scanner_ex.h:1.17 php4/ext/standard/url_scanner_ex.h:1.18 --- php4/ext/standard/url_scanner_ex.h:1.17 Sat Apr 27 10:07:52 2002 +++ php4/ext/standard/url_scanner_ex.h Sun Apr 28 07:45:45 2002 @@ -24,9 +24,9 @@ int php_url_scanner_ex_activate(TSRMLS_D); int php_url_scanner_ex_deactivate(TSRMLS_D); -char *url_adapt_ext_ex(const char *src, size_t srclen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen, zend_bool do_flush TSRMLS_DC); +char *url_adapt_ext_ex(const char *src, size_t srclen, const char *name, const char *value, size_t *newlen, zend_bool do_flush TSRMLS_DC); -char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen TSRMLS_DC); +char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC); char *url_adapt_flush(size_t * TSRMLS_DC); @@ -45,9 +45,6 @@ /* The data which is appended to each relative URL */ smart_str q_name; smart_str q_value; - - smart_str q_udata_name; - smart_str q_udata_value; char *lookup_data; int state; Index: php4/ext/standard/url_scanner_ex.re diff -u php4/ext/standard/url_scanner_ex.re:1.50 php4/ext/standard/url_scanner_ex.re:1.51 --- php4/ext/standard/url_scanner_ex.re:1.50 Sat Apr 27 10:07:52 2002 +++ php4/ext/standard/url_scanner_ex.re Sun Apr 28 07:45:45 2002 @@ -96,7 +96,7 @@ #define YYLIMIT q #define YYMARKER r -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *name, smart_str *val, smart_str *udata_name, smart_str *udata_value, const char *separator) +static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *name, smart_str *val, const char *separator) { register const char *p, *q; const char *bash = NULL; @@ -128,12 +128,6 @@ smart_str_append(dest, name); smart_str_appendc(dest, '='); smart_str_append(dest, val); - if (udata_name->len && udata_value->len) { - smart_str_appends(dest, separator); - smart_str_append(dest, udata_name); - smart_str_appendc(dest, '='); - smart_str_append(dest, udata_value); - } if (bash) smart_str_appendl(dest, bash, q - bash); @@ -156,7 +150,7 @@ if (quotes) smart_str_appendc(&ctx->result, type); if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->q_name, &ctx->q_value, &ctx->q_udata_name, &ctx->q_udata_value, PG(arg_separator).output); + append_modified_url(&ctx->val, &ctx->result, &ctx->q_name, &ctx->q_value, PG(arg_separator).output); } else { smart_str_append(&ctx->result, &ctx->val); } @@ -196,14 +190,6 @@ smart_str_appends(&ctx->result, "\" value=\""); smart_str_append(&ctx->result, &ctx->q_value); smart_str_appends(&ctx->result, "\" />"); - - if (ctx->q_udata_name.len) { - smart_str_appends(&ctx->result, "<input type=\"hidden\" name=\""); - smart_str_append(&ctx->result, &ctx->q_udata_name); - smart_str_appends(&ctx->result, "\" value=\""); - smart_str_append(&ctx->result, &ctx->q_udata_value); - smart_str_appends(&ctx->result, "\" />"); - } } } @@ -332,22 +318,18 @@ } -char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen TSRMLS_DC) +char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) { smart_str surl = {0}; smart_str buf = {0}; smart_str sname = {0}; smart_str sval = {0}; - smart_str aname = {0}; - smart_str avalue = {0}; smart_str_setl(&surl, url, urllen); smart_str_sets(&sname, name); smart_str_sets(&sval, value); - smart_str_sets(&aname, udata_name); - smart_str_sets(&avalue, udata_value); - append_modified_url(&surl, &buf, &sname, &sval, &aname, &avalue, PG(arg_separator).output); + append_modified_url(&surl, &buf, &sname, &sval, PG(arg_separator).output); smart_str_0(&buf); if (newlen) *newlen = buf.len; @@ -355,7 +337,7 @@ return buf.c; } -char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen, zend_bool do_flush TSRMLS_DC) +char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *value, size_t *newlen, zend_bool do_flush TSRMLS_DC) { url_adapt_state_ex_t *ctx; char *retval; @@ -364,10 +346,6 @@ smart_str_sets(&ctx->q_name, name); smart_str_sets(&ctx->q_value, value); - - smart_str_sets(&ctx->q_udata_name, udata_name); - smart_str_sets(&ctx->q_udata_value, udata_value); - xx_mainloop(ctx, src, srclen TSRMLS_CC); *newlen = ctx->result.len;
Index: php4/NEWS diff -u php4/NEWS:1.958 php4/NEWS:1.959 --- php4/NEWS:1.958 Sat Apr 27 21:49:42 2002 +++ php4/NEWS Sun Apr 28 07:45:45 2002 @@ -2,9 +2,6 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2002, Version 4.3.0 - If possible set Content-Length header in zlib.output_compression mode. (thies) -- Added session_set_userdata() which enables you to specify one variable that - will be kept in the browser in addition to the session-id. - Note: This only works with trans-sid sessions (no cookie). (thies) - Major update of domxml. New functions and better DOM compliance. (Uwe) - Added large OID value (2^31 to 2^32) support for pg_lo_import(), pg_lo_unlink(), pg_lo_open() and pg_lo_export(). (Yasuo) Index: php4/ext/session/php_session.h diff -u php4/ext/session/php_session.h:1.76 php4/ext/session/php_session.h:1.77 --- php4/ext/session/php_session.h:1.76 Sat Apr 27 10:07:50 2002 +++ php4/ext/session/php_session.h Sun Apr 28 07:45:45 2002 @@ -93,8 +93,6 @@ char *save_path; char *session_name; char *id; - char *udata_name; - char *udata_value; char *extern_referer_chk; char *entropy_file; char *cache_limiter; @@ -143,7 +141,6 @@ PHP_FUNCTION(session_set_cookie_params); PHP_FUNCTION(session_get_cookie_params); PHP_FUNCTION(session_write_close); -PHP_FUNCTION(session_set_userdata); #ifdef ZTS #define PS(v) TSRMG(ps_globals_id, php_ps_globals *, v) Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.298 php4/ext/session/session.c:1.299 --- php4/ext/session/session.c:1.298 Sat Apr 27 10:07:50 2002 +++ php4/ext/session/session.c Sun Apr 28 07:45:45 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.298 2002/04/27 14:07:50 thies Exp $ */ +/* $Id: session.c,v 1.299 2002/04/28 11:45:45 thies Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -71,13 +71,10 @@ PHP_FE(session_set_cookie_params, NULL) PHP_FE(session_get_cookie_params, NULL) PHP_FE(session_write_close, NULL) - PHP_FE(session_set_userdata, NULL) {NULL, NULL, NULL} }; /* }}} */ -#define SAFE_STRING(s) ((s)?(s):"") - ZEND_DECLARE_MODULE_GLOBALS(ps); static ps_module *_php_find_ps_module(char *name TSRMLS_DC); @@ -87,7 +84,7 @@ static void php_session_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) { if ((PS(session_status) == php_session_active)) { - *handled_output = url_adapt_ext_ex(output, output_len, PS(session_name), PS(id), SAFE_STRING(PS(udata_name)), SAFE_STRING(PS(udata_value)), handled_output_len, (zend_bool) (mode&PHP_OUTPUT_HANDLER_END ? 1 : 0) TSRMLS_CC); + *handled_output = url_adapt_ext_ex(output, output_len, PS(session_name), PS(id), handled_output_len, (zend_bool) (mode&PHP_OUTPUT_HANDLER_END ? 1 : 0) TSRMLS_CC); } else { *handled_output = NULL; } @@ -1406,32 +1403,11 @@ } /* }}} */ -/* {{{ proto bool session_set_userdata(string var, string value) - sets one additional variable that will be added by in trans-SID mode */ -PHP_FUNCTION(session_set_userdata) -{ - zval **str; - zval **val; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &str, &val) == FAILURE) - WRONG_PARAM_COUNT; - - if ((Z_TYPE_PP(str) != IS_STRING) || (Z_TYPE_PP(val) != IS_STRING)) { - php_error(E_ERROR,"session_set_userdata expects both parameters to be strings"); - RETURN_FALSE; - } - - PS(udata_name) = estrndup(Z_STRVAL_PP(str), Z_STRLEN_PP(str)); - PS(udata_value) = estrndup(Z_STRVAL_PP(val), Z_STRLEN_PP(val)); - - RETURN_TRUE; -} -/* }}} */ PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newlen TSRMLS_DC) { if (PS(apply_trans_sid) && (PS(session_status) == php_session_active)) { - *new = url_adapt_single_url(url, urllen, PS(session_name), PS(id), PS(udata_name), PS(udata_value), newlen TSRMLS_CC); + *new = url_adapt_single_url(url, urllen, PS(session_name), PS(id), newlen TSRMLS_CC); } } @@ -1454,17 +1430,6 @@ if (PS(id)) { efree(PS(id)); } - - if (PS(udata_name)) { - efree(PS(udata_name)); - PS(udata_name) = NULL; - } - - if (PS(udata_value)) { - efree(PS(udata_value)); - PS(udata_value) = NULL; - } - zend_hash_destroy(&PS(vars)); } Index: php4/ext/standard/url_scanner_ex.c diff -u php4/ext/standard/url_scanner_ex.c:1.56 php4/ext/standard/url_scanner_ex.c:1.57 --- php4/ext/standard/url_scanner_ex.c:1.56 Sun Apr 28 00:14:47 2002 +++ php4/ext/standard/url_scanner_ex.c Sun Apr 28 07:45:45 2002 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.5 on Sat Apr 28 00:00:01 2002 */ +/* Generated by re2c 0.5 on Sun Apr 28 13:43:23 2002 */ #line 1 "/home/thies/devel/php4/ext/standard/url_scanner_ex.re" /* +----------------------------------------------------------------------+ @@ -95,7 +95,7 @@ #define YYLIMIT q #define YYMARKER r -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *name, smart_str *val, smart_str *udata_name, smart_str *udata_value, const char *separator) +static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *name, smart_str *val, const char *separator) { register const char *p, *q; const char *bash = NULL; @@ -188,12 +188,6 @@ smart_str_append(dest, name); smart_str_appendc(dest, '='); smart_str_append(dest, val); - if (udata_name->len && udata_value->len) { - smart_str_appends(dest, separator); - smart_str_append(dest, udata_name); - smart_str_appendc(dest, '='); - smart_str_append(dest, udata_value); - } if (bash) smart_str_appendl(dest, bash, q - bash); @@ -216,7 +210,7 @@ if (quotes) smart_str_appendc(&ctx->result, type); if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->q_name, &ctx->q_value, &ctx->q_udata_name, &ctx->q_udata_value, PG(arg_separator).output); + append_modified_url(&ctx->val, &ctx->result, &ctx->q_name, &ctx->q_value, PG(arg_separator).output); } else { smart_str_append(&ctx->result, &ctx->val); } @@ -256,14 +250,6 @@ smart_str_appends(&ctx->result, "\" value=\""); smart_str_append(&ctx->result, &ctx->q_value); smart_str_appends(&ctx->result, "\" />"); - - if (ctx->q_udata_name.len) { - smart_str_appends(&ctx->result, "<input type=\"hidden\" name=\""); - smart_str_append(&ctx->result, &ctx->q_udata_name); - smart_str_appends(&ctx->result, "\" value=\""); - smart_str_append(&ctx->result, &ctx->q_udata_value); - smart_str_appends(&ctx->result, "\" />"); - } } } @@ -378,17 +364,17 @@ if(yybm[0+yych] & 128) goto yy15; yy13: yych = *++YYCURSOR; yy14: -#line 277 +#line 263 { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } yy15: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy16: if(yybm[0+yych] & 128) goto yy15; yy17: -#line 278 +#line 264 { passthru(STD_ARGS); goto state_plain; } } -#line 279 +#line 265 state_tag: @@ -442,11 +428,11 @@ yy20: yych = *++YYCURSOR; goto yy25; yy21: -#line 284 +#line 270 { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } yy22: yych = *++YYCURSOR; yy23: -#line 285 +#line 271 { passthru(STD_ARGS); goto state_plain_begin; } yy24: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -454,7 +440,7 @@ yy25: if(yybm[0+yych] & 128) goto yy24; goto yy21; } -#line 286 +#line 272 state_next_arg_begin: @@ -525,20 +511,20 @@ } yy28: yych = *++YYCURSOR; yy29: -#line 294 +#line 280 { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } yy30: yych = *++YYCURSOR; goto yy37; yy31: -#line 295 +#line 281 { passthru(STD_ARGS); goto state_next_arg; } yy32: yych = *++YYCURSOR; yy33: -#line 296 +#line 282 { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } yy34: yych = *++YYCURSOR; yy35: -#line 297 +#line 283 { passthru(STD_ARGS); goto state_plain_begin; } yy36: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -546,7 +532,7 @@ yy37: if(yybm[0+yych] & 128) goto yy36; goto yy31; } -#line 298 +#line 284 state_arg: @@ -600,11 +586,11 @@ yy40: yych = *++YYCURSOR; goto yy45; yy41: -#line 303 +#line 289 { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } yy42: yych = *++YYCURSOR; yy43: -#line 304 +#line 290 { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } yy44: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -612,7 +598,7 @@ yy45: if(yybm[0+yych] & 128) goto yy44; goto yy41; } -#line 305 +#line 291 state_before_val: @@ -667,12 +653,12 @@ if(yych == ' ') goto yy55; if(yych == '=') goto yy53; yy49: -#line 311 +#line 297 { --YYCURSOR; goto state_next_arg_begin; } yy50: yych = *++YYCURSOR; goto yy54; yy51: -#line 310 +#line 296 { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } yy52: yych = *++YYCURSOR; goto yy49; @@ -691,7 +677,7 @@ case 0: goto yy49; } } -#line 312 +#line 298 @@ -761,7 +747,7 @@ yych = *(YYMARKER = ++YYCURSOR); if(yych != '>') goto yy74; yy61: -#line 321 +#line 307 { passthru(STD_ARGS); goto state_next_arg_begin; } yy62: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -770,7 +756,7 @@ yy63: yych = *++YYCURSOR; goto yy67; yy64: -#line 320 +#line 306 { handle_val(STD_ARGS, 0, '"'); goto state_next_arg_begin; } yy65: yych = *++YYCURSOR; goto yy61; @@ -790,7 +776,7 @@ } yy71: yych = *++YYCURSOR; yy72: -#line 319 +#line 305 { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } yy73: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -799,10 +785,10 @@ if(yych >= '>') goto yy70; yy75: yych = *++YYCURSOR; yy76: -#line 318 +#line 304 { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } } -#line 322 +#line 308 stop: @@ -816,22 +802,18 @@ } -char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen TSRMLS_DC) +char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) { smart_str surl = {0}; smart_str buf = {0}; smart_str sname = {0}; smart_str sval = {0}; - smart_str aname = {0}; - smart_str avalue = {0}; smart_str_setl(&surl, url, urllen); smart_str_sets(&sname, name); smart_str_sets(&sval, value); - smart_str_sets(&aname, udata_name); - smart_str_sets(&avalue, udata_value); - append_modified_url(&surl, &buf, &sname, &sval, &aname, &avalue, PG(arg_separator).output); + append_modified_url(&surl, &buf, &sname, &sval, PG(arg_separator).output); smart_str_0(&buf); if (newlen) *newlen = buf.len; @@ -839,7 +821,7 @@ return buf.c; } -char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen, zend_bool do_flush TSRMLS_DC) +char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *value, size_t *newlen, zend_bool do_flush TSRMLS_DC) { url_adapt_state_ex_t *ctx; char *retval; @@ -848,10 +830,6 @@ smart_str_sets(&ctx->q_name, name); smart_str_sets(&ctx->q_value, value); - - smart_str_sets(&ctx->q_udata_name, udata_name); - smart_str_sets(&ctx->q_udata_value, udata_value); - xx_mainloop(ctx, src, srclen TSRMLS_CC); *newlen = ctx->result.len; Index: php4/ext/standard/url_scanner_ex.h diff -u php4/ext/standard/url_scanner_ex.h:1.17 php4/ext/standard/url_scanner_ex.h:1.18 --- php4/ext/standard/url_scanner_ex.h:1.17 Sat Apr 27 10:07:52 2002 +++ php4/ext/standard/url_scanner_ex.h Sun Apr 28 07:45:45 2002 @@ -24,9 +24,9 @@ int php_url_scanner_ex_activate(TSRMLS_D); int php_url_scanner_ex_deactivate(TSRMLS_D); -char *url_adapt_ext_ex(const char *src, size_t srclen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen, zend_bool do_flush TSRMLS_DC); +char *url_adapt_ext_ex(const char *src, size_t srclen, const char *name, const char *value, size_t *newlen, zend_bool do_flush TSRMLS_DC); -char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen TSRMLS_DC); +char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC); char *url_adapt_flush(size_t * TSRMLS_DC); @@ -45,9 +45,6 @@ /* The data which is appended to each relative URL */ smart_str q_name; smart_str q_value; - - smart_str q_udata_name; - smart_str q_udata_value; char *lookup_data; int state; Index: php4/ext/standard/url_scanner_ex.re diff -u php4/ext/standard/url_scanner_ex.re:1.50 php4/ext/standard/url_scanner_ex.re:1.51 --- php4/ext/standard/url_scanner_ex.re:1.50 Sat Apr 27 10:07:52 2002 +++ php4/ext/standard/url_scanner_ex.re Sun Apr 28 07:45:45 2002 @@ -96,7 +96,7 @@ #define YYLIMIT q #define YYMARKER r -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *name, smart_str *val, smart_str *udata_name, smart_str *udata_value, const char *separator) +static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *name, smart_str *val, const char *separator) { register const char *p, *q; const char *bash = NULL; @@ -128,12 +128,6 @@ smart_str_append(dest, name); smart_str_appendc(dest, '='); smart_str_append(dest, val); - if (udata_name->len && udata_value->len) { - smart_str_appends(dest, separator); - smart_str_append(dest, udata_name); - smart_str_appendc(dest, '='); - smart_str_append(dest, udata_value); - } if (bash) smart_str_appendl(dest, bash, q - bash); @@ -156,7 +150,7 @@ if (quotes) smart_str_appendc(&ctx->result, type); if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->q_name, &ctx->q_value, &ctx->q_udata_name, &ctx->q_udata_value, PG(arg_separator).output); + append_modified_url(&ctx->val, &ctx->result, &ctx->q_name, &ctx->q_value, PG(arg_separator).output); } else { smart_str_append(&ctx->result, &ctx->val); } @@ -196,14 +190,6 @@ smart_str_appends(&ctx->result, "\" value=\""); smart_str_append(&ctx->result, &ctx->q_value); smart_str_appends(&ctx->result, "\" />"); - - if (ctx->q_udata_name.len) { - smart_str_appends(&ctx->result, "<input type=\"hidden\" name=\""); - smart_str_append(&ctx->result, &ctx->q_udata_name); - smart_str_appends(&ctx->result, "\" value=\""); - smart_str_append(&ctx->result, &ctx->q_udata_value); - smart_str_appends(&ctx->result, "\" />"); - } } } @@ -332,22 +318,18 @@ } -char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen TSRMLS_DC) +char *url_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) { smart_str surl = {0}; smart_str buf = {0}; smart_str sname = {0}; smart_str sval = {0}; - smart_str aname = {0}; - smart_str avalue = {0}; smart_str_setl(&surl, url, urllen); smart_str_sets(&sname, name); smart_str_sets(&sval, value); - smart_str_sets(&aname, udata_name); - smart_str_sets(&avalue, udata_value); - append_modified_url(&surl, &buf, &sname, &sval, &aname, &avalue, PG(arg_separator).output); + append_modified_url(&surl, &buf, &sname, &sval, PG(arg_separator).output); smart_str_0(&buf); if (newlen) *newlen = buf.len; @@ -355,7 +337,7 @@ return buf.c; } -char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *value, char *udata_name, char *udata_value, size_t *newlen, zend_bool do_flush TSRMLS_DC) +char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *value, size_t *newlen, zend_bool do_flush TSRMLS_DC) { url_adapt_state_ex_t *ctx; char *retval; @@ -364,10 +346,6 @@ smart_str_sets(&ctx->q_name, name); smart_str_sets(&ctx->q_value, value); - - smart_str_sets(&ctx->q_udata_name, udata_name); - smart_str_sets(&ctx->q_udata_value, udata_value); - xx_mainloop(ctx, src, srclen TSRMLS_CC); *newlen = ctx->result.len;