@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | abstract class Mailcode_Translator_Syntax_ApacheVelocity extends Mailcode_Translator_Command |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * @var string[] |
|
| 25 | - */ |
|
| 23 | + /** |
|
| 24 | + * @var string[] |
|
| 25 | + */ |
|
| 26 | 26 | private $regexSpecialChars = array( |
| 27 | 27 | '?', |
| 28 | 28 | '.', |
@@ -47,15 +47,15 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * Filters the string for use in an Apache Velocity (Java) |
|
| 51 | - * regex string: escapes all special characters. |
|
| 52 | - * |
|
| 53 | - * Velocity does its own escaping, so no need to escape special |
|
| 54 | - * characters as if they were a javascript string. |
|
| 55 | - * |
|
| 56 | - * @param string $string |
|
| 57 | - * @return string |
|
| 58 | - */ |
|
| 50 | + * Filters the string for use in an Apache Velocity (Java) |
|
| 51 | + * regex string: escapes all special characters. |
|
| 52 | + * |
|
| 53 | + * Velocity does its own escaping, so no need to escape special |
|
| 54 | + * characters as if they were a javascript string. |
|
| 55 | + * |
|
| 56 | + * @param string $string |
|
| 57 | + * @return string |
|
| 58 | + */ |
|
| 59 | 59 | protected function filterRegexString(string $string) : string |
| 60 | 60 | { |
| 61 | 61 | // Special case: previously escaped quotes. |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | |
| 70 | 70 | // All other special characters have to be escaped |
| 71 | 71 | // with two backslashes. |
| 72 | - foreach($this->regexSpecialChars as $char) |
|
| 72 | + foreach ($this->regexSpecialChars as $char) |
|
| 73 | 73 | { |
| 74 | 74 | $string = str_replace($char, '\\'.$char, $string); |
| 75 | 75 | } |