For certain lengths of HTTP_COOKIE, it seems that SSI regexes (in "expr=" statements) fail to capture the full length of the HTTP_COOKIE variable when using capturing parentheses. Here's an example, tested on 2.0.52 on two different Linux servers: <!--#set var="HTTP_COOKIE" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=n" --> Your HTTP_COOKIE is: "<!--#echo var="HTTP_COOKIE" -->" <!--#if expr="$HTTP_COOKIE = /(.+)/" --> ...but captured from a regex using (.+), it's truncated to this: "<!--#echo var="1" -->" <!--#endif --> In case this form/webpage messes with that code, just visit this URL: http://nodivisions.com/test.shtml Note that the actual value of HTTP_COOKIE doesn't matter; I found this bug while using 3 real cookie values in it, but then replaced them with all Xes to test. Only the length seems to matter.
Created attachment 13999 [details] proposed fix There's an off-by-one in the handling of variables which expand to 128 characters, this is a fix, not sure if it's the *correct* fix...
Created attachment 14025 [details] variable truncation fix #2 fix for variable truncation issue (now with comment)
Fix committed for 2.0.53; thanks for the simple repro case!
You're welcome; glad to help. Thanks for the fix!