From: Stefan Fritsch Date: Sun, 21 Nov 2010 17:39:52 +0000 (+0000) Subject: ap_expr related fixes and enhancements X-Git-Tag: 2.3.9~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e4add122ce0800b03d88c4032ed119e9c73dfac;p=thirdparty%2Fapache%2Fhttpd.git ap_expr related fixes and enhancements git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037510 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/convenience.map b/docs/manual/convenience.map index fe43bbe39ab..06638c1956e 100644 --- a/docs/manual/convenience.map +++ b/docs/manual/convenience.map @@ -111,8 +111,8 @@ bufferedlogs mod/mod_log_config.html#bufferedlogs buffersize mod/mod_buffer.html#buffersize cachedefaultexpire mod/mod_cache.html#cachedefaultexpire cachedetailheader mod/mod_cache.html#cachedetailheader -cachedirlength mod/mod_disk_cache.html#cachedirlength -cachedirlevels mod/mod_disk_cache.html#cachedirlevels +cachedirlength mod/mod_cache_disk.html#cachedirlength +cachedirlevels mod/mod_cache_disk.html#cachedirlevels cachedisable mod/mod_cache.html#cachedisable cacheenable mod/mod_cache.html#cacheenable cachefile mod/mod_file_cache.html#cachefile @@ -128,14 +128,14 @@ cachelock mod/mod_cache.html#cachelock cachelockmaxage mod/mod_cache.html#cachelockmaxage cachelockpath mod/mod_cache.html#cachelockpath cachemaxexpire mod/mod_cache.html#cachemaxexpire -cachemaxfilesize mod/mod_disk_cache.html#cachemaxfilesize +cachemaxfilesize mod/mod_cache_disk.html#cachemaxfilesize cacheminexpire mod/mod_cache.html#cacheminexpire -cacheminfilesize mod/mod_disk_cache.html#cacheminfilesize +cacheminfilesize mod/mod_cache_disk.html#cacheminfilesize cachenegotiateddocs mod/mod_negotiation.html#cachenegotiateddocs cachequickhandler mod/mod_cache.html#cachequickhandler -cachereadsize mod/mod_disk_cache.html#cachereadsize -cachereadtime mod/mod_disk_cache.html#cachereadtime -cacheroot mod/mod_disk_cache.html#cacheroot +cachereadsize mod/mod_cache_disk.html#cachereadsize +cachereadtime mod/mod_cache_disk.html#cachereadtime +cacheroot mod/mod_cache_disk.html#cacheroot cachestaleonerror mod/mod_cache.html#cachestaleonerror cachestoreexpired mod/mod_cache.html#cachestoreexpired cachestorenostore mod/mod_cache.html#cachestorenostore @@ -190,6 +190,7 @@ dumpiooutput mod/mod_dumpio.html#dumpiooutput enableexceptionhook mod/mpm_common.html#enableexceptionhook enablemmap mod/core.html#enablemmap enablesendfile mod/core.html#enablesendfile +error mod/core.html#error errordocument mod/core.html#errordocument errorlog mod/core.html#errorlog errorlogformat mod/core.html#errorlogformat @@ -429,6 +430,7 @@ sessioninclude mod/mod_session.html#sessioninclude sessionmaxage mod/mod_session.html#sessionmaxage setenv mod/mod_env.html#setenv setenvif mod/mod_setenvif.html#setenvif +setenvifexpr mod/mod_setenvif.html#setenvifexpr setenvifnocase mod/mod_setenvif.html#setenvifnocase sethandler mod/core.html#sethandler setinputfilter mod/core.html#setinputfilter @@ -488,6 +490,7 @@ sslverifydepth mod/mod_ssl.html#sslverifydepth startservers mod/mpm_common.html#startservers startthreads mod/mpm_common.html#startthreads substitute mod/mod_substitute.html#substitute +suexec mod/mod_unixd.html#suexec suexecusergroup mod/mod_suexec.html#suexecusergroup threadlimit mod/mpm_common.html#threadlimit threadsperchild mod/mpm_common.html#threadsperchild diff --git a/docs/manual/expr.html.en b/docs/manual/expr.html.en index 6aeba3415ae..a3d74ac47d7 100644 --- a/docs/manual/expr.html.en +++ b/docs/manual/expr.html.en @@ -33,6 +33,7 @@
  • Binary operators
  • Unary operators
  • Functions
  • +
  • Other
  • top
    @@ -57,12 +58,12 @@ comp ::= stringcomp | word "!~" regex -stringcomp ::= word "==" word | word "eq" word - | word "!=" word | word "ne" word - | word "<" word | word "lt" word - | word "<=" word | word "le" word - | word ">" word | word "gt" word - | word ">=" word | word "ge" word +stringcomp ::= word "==" word + | word "!=" word + | word "<" word + | word "<=" word + | word ">" word + | word ">=" word integercomp ::= word "-eq" word | word "eq" word | word "-ne" word | word "ne" word @@ -79,6 +80,7 @@ word ::= word "." word | "'" string "'" | """ string """ | variable + | rebackref | function string ::= stringpart @@ -86,6 +88,7 @@ string ::= stringpart stringpart ::= cstring | variable + | rebackref cstring ::= ... digit ::= [0-9]+ @@ -93,6 +96,8 @@ digit ::= [0-9]+ variable ::= "%{" varname "}" | "%{" funcname ":" funcargs "}" +rebackref ::= "$" [0-9] + function ::= funcname "(" word ")" listfunction ::= listfuncname "(" word ")" @@ -302,9 +307,40 @@ listfunction ::= listfuncname "(" word ")" Functions names are not case sensitive. Modules may register additional functions.

    -

    There are no built-in list-valued functions. mod_ssl's - SSLRequire provides - PeerExtList.

    +

    There are no built-in list-valued functions. mod_ssl + provides PeerExtList. See the description of + SSLRequire for details + (but PeerExtList is also usable outside + of SSLRequire).

    + +
    top
    +
    +

    Other

    + + + + + + + + + + + + + + +
    NameAlternative Description
    -ininstring contained in string list
    /regexp/m#regexp#Regular expression (the second form allows different delimiters than /)
    /regexp/im#regexp#iCase insensitive regular expression
    $0 ... $9 + Regular expression backreferences
    + +

    Regular expression backreferences

    + +

    The strings $0 ... $9 allow to reference + the capture groups form a previously executed, successfully + matching regular expressions. They can normally only be used in the + same expression as the matching regex, but some modules allow special + uses.

    +
    diff --git a/docs/manual/expr.xml b/docs/manual/expr.xml index fd672e4007f..a5e046b7adf 100644 --- a/docs/manual/expr.xml +++ b/docs/manual/expr.xml @@ -54,12 +54,12 @@ comp ::= stringcomp | word "!~" regex -stringcomp ::= word "==" word | word "eq" word - | word "!=" word | word "ne" word - | word "<" word | word "lt" word - | word "<=" word | word "le" word - | word ">" word | word "gt" word - | word ">=" word | word "ge" word +stringcomp ::= word "==" word + | word "!=" word + | word "<" word + | word "<=" word + | word ">" word + | word ">=" word integercomp ::= word "-eq" word | word "eq" word | word "-ne" word | word "ne" word @@ -76,6 +76,7 @@ word ::= word "." word | "'" string "'" | """ string """ | variable + | rebackref | function string ::= stringpart @@ -83,6 +84,7 @@ string ::= stringpart stringpart ::= cstring | variable + | rebackref cstring ::= ... digit ::= [0-9]+ @@ -90,6 +92,8 @@ digit ::= [0-9]+ variable ::= "%{" varname "}" | "%{" funcname ":" funcargs "}" +rebackref ::= "$" [0-9] + function ::= funcname "(" word ")" listfunction ::= listfuncname "(" word ")" @@ -319,9 +323,43 @@ listfunction ::= listfuncname "(" word ")" Functions names are not case sensitive. Modules may register additional functions.

    -

    There are no built-in list-valued functions. mod_ssl's - SSLRequire provides - PeerExtList.

    +

    There are no built-in list-valued functions. mod_ssl + provides PeerExtList. See the description of + SSLRequire for details + (but PeerExtList is also usable outside + of SSLRequire).

    + + + +
    + Other + + + + + + + + + + + + + + + + + +
    NameAlternative Description
    -ininstring contained in string list
    /regexp/m#regexp#Regular expression (the second form allows different delimiters than /)
    /regexp/im#regexp#iCase insensitive regular expression
    $0 ... $9Regular expression backreferences
    + +
    + Regular expression backreferences +

    The strings $0 ... $9 allow to reference + the capture groups form a previously executed, successfully + matching regular expressions. They can normally only be used in the + same expression as the matching regex, but some modules allow special + uses.

    +
    diff --git a/docs/manual/mod/mod_include.html.en b/docs/manual/mod/mod_include.html.en index e9dc7c62b39..0660b85cc9a 100644 --- a/docs/manual/mod/mod_include.html.en +++ b/docs/manual/mod/mod_include.html.en @@ -720,10 +720,7 @@ be escaped. This is regardless of their meaning to the regex engine.

    -

    Reference Documentation

    -

    See also: Expressions in Apache HTTP Server, - for a complete reference and examples.

    -
    +
    top

    SSIAccessEnable Directive

    diff --git a/docs/manual/mod/mod_include.xml b/docs/manual/mod/mod_include.xml index c817ae7b6f9..9828384a72d 100644 --- a/docs/manual/mod/mod_include.xml +++ b/docs/manual/mod/mod_include.xml @@ -713,10 +713,12 @@ be escaped. This is regardless of their meaning to the regex engine.

    + diff --git a/docs/manual/mod/mod_setenvif.html.en b/docs/manual/mod/mod_setenvif.html.en index 2f4b57cd517..7c0373d3a66 100644 --- a/docs/manual/mod/mod_setenvif.html.en +++ b/docs/manual/mod/mod_setenvif.html.en @@ -280,7 +280,7 @@ for additional examples. and applied env-variable in the same fashion as SetEnvIf.

    - SetEnvIfExpr "tolower(%req['X-Sendfile']) = 'D:\images\very_big.iso')" iso_delivered + SetEnvIfExpr "tolower(req('X-Sendfile')) == 'd:\images\very_big.iso')" iso_delivered

    This would set the environment variable iso_delivered @@ -290,7 +290,7 @@ for additional examples. example from above for a site with more than one domain:

    - SetEnvIfExpr "${HTTP_REFERER} in www.example.com,example.com,w2.example3.org" intra_site_referral + SetEnvIfExpr "${HTTP_REFERER} in { 'www.example.com','example.com','w2.example3.org' }" intra_site_referral

    See also

    @@ -300,7 +300,6 @@ for a complete reference and more examples.
  • <If> can be used to achive similar results.
  • mod_filter
  • -
  • mod_include>
  • top
    diff --git a/docs/manual/mod/mod_setenvif.xml b/docs/manual/mod/mod_setenvif.xml index ef639a0a2c7..b0062c27ee2 100644 --- a/docs/manual/mod/mod_setenvif.xml +++ b/docs/manual/mod/mod_setenvif.xml @@ -275,7 +275,7 @@ for additional examples. >SetEnvIf.

    - SetEnvIfExpr "tolower(%req['X-Sendfile']) = 'D:\images\very_big.iso')" iso_delivered + SetEnvIfExpr "tolower(req('X-Sendfile')) == 'd:\images\very_big.iso')" iso_delivered

    This would set the environment variable iso_delivered @@ -285,7 +285,7 @@ for additional examples. example from above for a site with more than one domain:

    - SetEnvIfExpr "${HTTP_REFERER} in www.example.com,example.com,w2.example3.org" intra_site_referral + SetEnvIfExpr "${HTTP_REFERER} in { 'www.example.com','example.com','w2.example3.org' }" intra_site_referral @@ -294,7 +294,6 @@ for a complete reference and more examples. If can be used to achive similar results. mod_filter -mod_include> diff --git a/docs/manual/mod/mod_ssl.html.en b/docs/manual/mod/mod_ssl.html.en index 5810bf2189a..a042e176583 100644 --- a/docs/manual/mod/mod_ssl.html.en +++ b/docs/manual/mod/mod_ssl.html.en @@ -1596,15 +1596,9 @@ function ::= funcname "(" funcargs ")"

    For varname any of the variables described in Environment Variables can be used. For -funcname the following functions are available:

    - +funcname the available functions are listed in +the ap_expr documentation.

    +

    Notice that expression is first parsed into an internal machine representation and then evaluated in a second step. Actually, in Global and Per-Server Class context expression is parsed at startup time and diff --git a/docs/manual/mod/mod_ssl.xml b/docs/manual/mod/mod_ssl.xml index ca489fe5cb0..13f0a969ea7 100644 --- a/docs/manual/mod/mod_ssl.xml +++ b/docs/manual/mod/mod_ssl.xml @@ -1267,15 +1267,9 @@ function ::= funcname "(" funcargs ")"

    For varname any of the variables described in Environment Variables can be used. For -funcname the following functions are available:

    - +funcname the available functions are listed in +the ap_expr documentation.

    +

    Notice that expression is first parsed into an internal machine representation and then evaluated in a second step. Actually, in Global and Per-Server Class context expression is parsed at startup time and