http://cvs.php.net/viewvc.cgi/php-src/ext/standard/url_scanner_ex.re?r1=1.76.2.2.2.1&r2=1.76.2.2.2.2&view=patch --- old/ext/standard/url_scanner_ex.re 2007/06/06 00:00:27 1.76.2.2.2.1 +++ new/ext/standard/url_scanner_ex.re 2007/10/10 00:35:52 1.76.2.2.2.2 @@ -205,24 +205,35 @@ if (ctx->form_app.len > 0) { switch (ctx->tag.len) { - -#define RECOGNIZE(x) do { \ - case sizeof(x)-1: \ - if (strncasecmp(ctx->tag.c, x, sizeof(x)-1) == 0) \ - doit = 1; \ - break; \ -} while (0) - - RECOGNIZE("form"); - RECOGNIZE("fieldset"); + case sizeof("form") - 1: + if (!strncasecmp(ctx->tag.c, "form", sizeof("form") - 1)) { + doit = 1; + } + if (doit && ctx->val.c && ctx->lookup_data && *ctx->lookup_data) { + char *e, *p = zend_memnstr(ctx->val.c, "://", sizeof("://") - 1, ctx->val.c + ctx->val.len); + if (p) { + e = memchr(p, '/', (ctx->val.c + ctx->val.len) - p); + if (!e) { + e = ctx->val.c + ctx->val.len; + } + if ((e - p) && strncasecmp(p, ctx->lookup_data, (e - p))) { + doit = 0; + } + } + } + break; + + case sizeof("fieldset") - 1: + if (!strncasecmp(ctx->tag.c, "fieldset", sizeof("fieldset") - 1)) { + doit = 1; + } + break; } if (doit) smart_str_append(&ctx->result, &ctx->form_app); } } - - /* * HANDLE_TAG copies the HTML Tag and checks whether we