]> granicus.if.org Git - php/commitdiff
Fix #13472 by making it possible to append the <input> stuff after
authorSascha Schumann <sas@php.net>
Wed, 25 Sep 2002 11:06:24 +0000 (11:06 +0000)
committerSascha Schumann <sas@php.net>
Wed, 25 Sep 2002 11:06:24 +0000 (11:06 +0000)
<fieldset> for xhtml compliance.

ext/standard/url_scanner_ex.re
php.ini-dist

index c003d6b5294478af732cf66c7ef5ec900076b2c1..e35ce9af63c2bd69e94bd878fad859bcdbd561d1 100644 (file)
@@ -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,
index fc2211be0c3f3521576161f0762fa95892a5b694..59ad4f200ea988ee30253dce35e0943507f8ae1e 100644 (file)
@@ -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.