X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fexpression-functions.php;h=c8129ddb21dc2072b52edb1ff0b8cff43c2481f0;hb=e3f273938e4e3b8045853ab4bd746d01fa8ade04;hp=47da9de13818aff53d7dc1bfbf76f85613678ac5;hpb=d3871e8ae2b4971563132abce52a7771756600e2;p=mailer.git diff --git a/inc/expression-functions.php b/inc/expression-functions.php index 47da9de138..c8129ddb21 100644 --- a/inc/expression-functions.php +++ b/inc/expression-functions.php @@ -65,7 +65,7 @@ function isExpressionFunctionAvaiable ($data) { // Add non-empty parts if (!empty($piece)) { // Add it - $functionName .= ucfirst(strtolower($piece)); + $functionName .= capitalizeUnderscoreString($piece); } // END - if } // END - foreach @@ -146,7 +146,7 @@ function doExpressionExt ($data) { // Is the extension installed? if (isExtensionInstalled($data['matches'][4][$data['key']])) { // Construct call-back function name - $functionName = 'getExtension' . ucfirst(strtolower($data['callback'])); + $functionName = 'getExtension' . capitalizeUnderscoreString($data['callback']); // Construct call of the function $replacer = "{DQUOTE} . call_user_func_array('" . $functionName . "', array('" . $data['matches'][4][$data['key']] . "', true)) . {DQUOTE}"; @@ -168,7 +168,7 @@ function doExpressionConfig ($data) { // Do we have a special expression function for it? if (isExpressionFunctionAvaiable($data)) { // Then use it - $replacer = '{DQUOTE} . ' . $data['callback'] . '('.getExpressionFunction($data).'(' . "'" . $data['matches'][4][$data['key']] . "'" . ')) . {DQUOTE}'; + $replacer = '{DQUOTE} . ' . $data['callback'] . '(' . getExpressionFunction($data) . '()) . {DQUOTE}'; } else { // Default replacer is the config value itself $replacer = '{DQUOTE} . ' . $data['callback'] . '(getConfig(' . "'" . $data['matches'][4][$data['key']] . "'" . ')) . {DQUOTE}'; @@ -301,5 +301,29 @@ function doExpressionMath ($data) { return $code; } +// Expression call-back for GET request +function doExpressionGet ($data) { + // Construct the replacer + $replacer = '{%pipe,getRequestParameter=' . $data['value'] . '%}'; + + // Replace the code + $code = replaceExpressionCode($data, $replacer); + + // Return the (maybe) replaced code + return $code; +} + +// Expression call-back for POST request +function doExpressionPost ($data) { + // Construct the replacer + $replacer = '{%pipe,postRequestParameter=' . $data['value'] . '%}'; + + // Replace the code + $code = replaceExpressionCode($data, $replacer); + + // Return the (maybe) replaced code + return $code; +} + // [EOF] ?>