On Tue, Aug 3, 2021 at 11:43 AM Eric Covener <[email protected]> wrote:
>
> It looks like replace() was broken somewhere after it was committed,
> but I can't tell how.
> Does it work for anyone?
>
> There seems to be some confusion about the arguments.
>
> 1. During parsing, a weird loop in ap_expr_info_make causes the final
> list argument to be parsed as the strmatch pattern, but the last
> element is the replacement string not the pattern (from). The 2nd
> argument is the pattern.
> Jan's example was:
> Require expr replace(%{REQUEST_METHOD},  "E", "O") == "GOT"
> and trace confirms that the pattern is "O"
>
> 2. During evaluation, The remaining arguments are passed in an array
> that skips over the first value, but it still expects three arguments
> in the array.
> [Tue Aug 03 15:32:40.807613 2021] [authz_core:error] [pid 33929:tid
> 123145531994112] [client 127.0.0.1:64195] AH03299: Evaluation of
> expression from
> /Users/covener/SRC/httpd-trunk/built/conf/httpd.conf:544 failed:
> replace() function needs exactly 3 arguments
>
> Unfortunately I think these same quirks are passed on to any
> list-based string function registered dynamically by a module.  But
> fortunately they are trunk-only.
>

Looks like some of the confusion comes from the type of the args, some
of my testing was with literal strings and some not.

Reply via email to