From aa6f7ad99604322c591bd5dfb997521ad1ec0b78 Mon Sep 17 00:00:00 2001 From: Rick Bargerhuff Date: Fri, 21 May 2021 13:00:37 -0400 Subject: [PATCH] Addresses issue #56. - Regex updated to make sure we're not evaluating a basic string/sentence wrapped in single quotes in order to prevent unnecessary warnings. - Regex now references the $raw_value variable that was preventing the warning from being written. --- conversions/call.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conversions/call.inc b/conversions/call.inc index 27bba71..22ff60e 100644 --- a/conversions/call.inc +++ b/conversions/call.inc @@ -82,7 +82,7 @@ function coder_upgrade_upgrade_call_variable_get_alter(&$node, &$reader) { // DO // Any special characters in the variable, it's beyond our handling, so // just insert the warning. - elseif (preg_match('@[\.\s\$\[\]\#\>\(]@', $value)) { + elseif (!preg_match('@^\'[^\']*\'$@', $raw_value) && preg_match('@[\.\s\$\[\]\#\>\(]@', $raw_value)) { $value = 'dynamic value in file ' . $path . ' line ' . $node->line; }