Commit 236da7e9 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Refs #8043 / Escape Class "Exception"

parent bcbb53d4
...@@ -731,6 +731,10 @@ const TOKEN_ESCAPE_MYSQL = 'm'; ...@@ -731,6 +731,10 @@ const TOKEN_ESCAPE_MYSQL = 'm';
const TOKEN_ESCAPE_PASSWORD_T3FE = 'p'; const TOKEN_ESCAPE_PASSWORD_T3FE = 'p';
const TOKEN_ESCAPE_NONE = '-'; const TOKEN_ESCAPE_NONE = '-';
const TOKEN_ESCAPE_STOP_REPLACE = 'S';
const TOKEN_ESCAPE_EXCEPTION = 'X';
#const TOKEN_ESCAPE_ACTION = 'A';
// Workaround for PHP < 5.6.0 // Workaround for PHP < 5.6.0
if (!function_exists('ldap_escape')) { if (!function_exists('ldap_escape')) {
define('LDAP_ESCAPE_FILTER', 0x01); define('LDAP_ESCAPE_FILTER', 0x01);
......
...@@ -298,6 +298,7 @@ class Evaluate { ...@@ -298,6 +298,7 @@ class Evaluate {
$token = trim($token); $token = trim($token);
$dbIndex = $this->dbIndex; $dbIndex = $this->dbIndex;
$flagThrowExceptionIfNotFound = false;
// Check if the $token starts with '[<int>]...' - yes: open the necessary database. // Check if the $token starts with '[<int>]...' - yes: open the necessary database.
if (strlen($token) > 2 && $token[0] === '[') { if (strlen($token) > 2 && $token[0] === '[') {
...@@ -349,7 +350,6 @@ class Evaluate { ...@@ -349,7 +350,6 @@ class Evaluate {
if ($type == DND_DATA_DND_API) { if ($type == DND_DATA_DND_API) {
return ($this->inlineDataDndApi($arrToken, $dbIndex, $foundInStore)); return ($this->inlineDataDndApi($arrToken, $dbIndex, $foundInStore));
} }
} }
...@@ -394,6 +394,12 @@ class Evaluate { ...@@ -394,6 +394,12 @@ class Evaluate {
case TOKEN_ESCAPE_PASSWORD_T3FE: case TOKEN_ESCAPE_PASSWORD_T3FE:
$value = Password::getHash($value); $value = Password::getHash($value);
break; break;
case TOKEN_ESCAPE_STOP_REPLACE:
$value = Support::encryptDoubleCurlyBraces($value);
break;
case TOKEN_ESCAPE_EXCEPTION:
$flagThrowExceptionIfNotFound = true;
break;
default: default:
throw new UserFormException("Unknown escape qualifier: $escape", UNKNOWN_TYPE); throw new UserFormException("Unknown escape qualifier: $escape", UNKNOWN_TYPE);
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment