Welcome! Log In Create A New Profile

Advanced

[PATCH] sub_filter bug

Anonymous User
May 22, 2014 03:54AM
Hi,

Could you take a look at the following patch?


# HG changeset patch
# User KAWAHARA Masashi <anthrax@unixuser.org>
# Date 1400671481 -32400
# Wed May 21 20:24:41 2014 +0900
# Node ID 3949e591694fff37a436a076f4d4006c802587c7
# Parent 1209b8a7b077c7bbf161e502964308736c84db6f
Bugfix: When both sub_filter and SSI were used and the include file was
not terminated by newline, it was transmitted incorrectly.
ex.
conf:
ssi on
sub_filter '//check-string' '//replace-string'

contents:
index.shtml:
<!--#include virtual="/test.html"-->//check-string

test.html: (!! saved no newline at end of line !!)
include-text/

output:
include-test//replace-string

correct output:
include-test///replace-string

diff -r 1209b8a7b077 -r 3949e591694f src/http/modules/ngx_http_sub_filter_module.c
--- a/src/http/modules/ngx_http_sub_filter_module.c Tue May 20 16:10:07 2014 +0400
+++ b/src/http/modules/ngx_http_sub_filter_module.c Wed May 21 20:24:41 2014 +0900
@@ -539,6 +539,9 @@

for ( ;; ) {
if (ch == match) {
+ if ((p + 1) == last && state != sub_match_state) {
+ goto match_started;
+ }
copy_end = p;
ctx->looked.data[0] = *p;
looked = 1;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] sub_filter bug

Anonymous User 688 May 22, 2014 03:54AM

Re: [PATCH] sub_filter bug

Maxim Dounin 523 May 22, 2014 01:14PM

Re: [PATCH] sub_filter bug

川原将司 455 May 23, 2014 03:00AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 194
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready