Apache regex backreferences UNREACHABLE in httpd 2.4? -


i love new apache httpd 2.4 lots of new cool stuff !

ap_expr 1 of these new promising features,

..but following ssi snippet don't work expected:

{{if expr="v('http_session') =~ /-user=([^&]+)/"}}  {{set var="user" value="$1"}}  {{endif}} 

the if working var isn't set ! doesn't make sense.

error.log says:

.. ah01330: regex capture $1 out of range 

the doc (http://httpd.apache.org/docs/2.4/expr.html#other) confusing , have no samples anywhere near.

i know there legacy (workaround) switch ssi.. don't want use since old start- , end-tags forced legacy

doing similar regex-parsing-tricks w setenvifexpr not helping either

by changing

{{if expr="v('http_session') =~ /-user=([^&]+)/"}}      {{set var="user" value="$1"}}  {{endif}} 

to

{{if expr="v('http_session') =~ /-user=([^&]+)/"}}      {{set var="user" value="$0"}}     {{if expr="v('user') =~ /([^&]+)$/"}}          {{set var="user" value="$0"}}     {{endif}} {{endif}} 

one can work around problem using fact $0 seems work


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

node.js - Bad Request - node js ajax post -

uitableview - Create and use custom prototype table cells in xamarin ios using storyboard -