Class ApacheEscape
- Author:
- AO Industries, Inc.
-
Field Summary
-
Method Summary
-
Field Details
-
DEFAULT_DOLLAR_VARIABLE
- See Also:
-
-
Method Details
-
escape
Escapes arbitrary text to be used in an Apache directive. Adds double quotes as-needed. Please note that '$' is also escaped when found in form${variable}
, so this might not be appropriate for${variable}
substitutions.Please note, the dollar escaping relies on Apache being configured with
Define <dollarVariable> $
, as it is performed with a${dollarVariable}
hack.- See Also:
-
escape
Escapes arbitrary text to be used in an Apache directive. Adds double quotes as-needed. Optionally allowing '$' unescaped.Please note, the dollar escaping relies on Apache being configured with
Define $ $
, as it is performed with a${$}
hack. This is set in the aoserv-httpd-config package, incore.inc
.I am unable to find clear documentation on the full set of rules for escaping Apache directives. I have experimented with various values and techniques to achieve this implementation. It seems there is no useful way to encode completely arbitrary values into directives. Thus, this set of rules may not be optimal (may perform more escaping than necessary) or, even worse, could be incomplete.
- Returns:
- the escaped string or the original string when no escaping required
- See Also:
-