diff options
| author | Sascha Schumann <sas@php.net> | 2002-09-25 11:06:24 +0000 | 
|---|---|---|
| committer | Sascha Schumann <sas@php.net> | 2002-09-25 11:06:24 +0000 | 
| commit | 7af64ef5318c74cbcc536a979c6ea77a7527a3b9 (patch) | |
| tree | 564002987c39bdbcd5b9100a89375217d3648cc6 | |
| parent | 91bbb302c180efd7a9f566af4c3abf2e617b0d33 (diff) | |
| download | php-git-7af64ef5318c74cbcc536a979c6ea77a7527a3b9.tar.gz | |
Fix #13472 by making it possible to append the <input> stuff after
<fieldset> for xhtml compliance.
| -rw-r--r-- | ext/standard/url_scanner_ex.re | 33 | ||||
| -rw-r--r-- | php.ini-dist | 12 | 
2 files changed, 33 insertions, 12 deletions
| diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index c003d6b529..e35ce9af63 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -81,7 +81,7 @@ static PHP_INI_MH(OnUpdateTags)  }  PHP_INI_BEGIN() -	STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=fakeentry", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals) +	STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals)  PHP_INI_END()  /*!re2c @@ -180,15 +180,36 @@ static inline void passthru(STD_PARA)  	smart_str_appendl(&ctx->result, start, YYCURSOR - start);  } -static inline void handle_form(STD_PARA)  +/* + * This function appends a hidden input field after a <form> or + * <fieldset>.  The latter is important for XHTML. + */ + +static void handle_form(STD_PARA)   { -	if (ctx->form_app.len > 0  -			&& ctx->tag.len == 4  -			&& strncasecmp(ctx->tag.c, "form", 4) == 0) { -		smart_str_append(&ctx->result, &ctx->form_app); +	int doit = 0; + +	if (ctx->form_app.len > 0) { +		switch (ctx->tag.len) { +		 +			case sizeof("form")-1: +				if (strcasecmp(ctx->tag.c, "form") == 0) +					doit = 1; +				break; + +			case sizeof("fieldset")-1: +				if (strcasecmp(ctx->tag.c, "fieldset") == 0) +					doit = 1; +				break; +		} + +		if (doit) +			smart_str_append(&ctx->result, &ctx->form_app);  	}  } + +  /*   *  HANDLE_TAG copies the HTML Tag and checks whether we    *  have that tag in our table. If we might modify it, diff --git a/php.ini-dist b/php.ini-dist index fc2211be0c..59ad4f200e 100644 --- a/php.ini-dist +++ b/php.ini-dist @@ -104,11 +104,11 @@ output_buffering = Off  ; Valid values for this option are 'off', 'on', or a specific buffer size  ; to be used for compression (default is 4KB)  ; Note: Resulting chunk size may vary due to nature of compression. PHP  -;       outputs chunks that are few handreds bytes each as a result of compression.  -;       If you want larger chunk size for better performence, enable output_buffering  -;       also.  -; Note: output_handler must be empty if this is set 'On' !!!! -;       Instead you must use zlib.output_handler. +;       outputs chunks that are few hundreds bytes each as a result of  +;       compression. If you prefer a larger chunk size for better  +;       performance, enable output_buffering in addition. +; Note: You need to use zlib.output_handler instead of the standard +;       output_handler, or otherwise the output will be corrupted.  zlib.output_compression = Off  ; You cannot specify additional output handlers if zlib.output_compression @@ -836,7 +836,7 @@ session.cache_expire = 180  ;   always using URL stored in browser's history or bookmarks.  session.use_trans_sid = 0 -url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" +url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="  [MSSQL]  ; Allow or prevent persistent links. | 
