diff --git a/potx.inc b/potx.inc index 5d98b11..1405150 100644 --- a/potx.inc +++ b/potx.inc @@ -232,7 +232,7 @@ function _potx_process_file($file_path, $strip_prefix = 0, $save_callback = '_po if (is_array($token)) { $token[] = $line_number; - $constraint_match = $constraint_extract && $token[0] == T_VARIABLE && (stripos($token[1], 'message') !== NULL); + $constraint_match = $constraint_extract && $token[0] == T_VARIABLE && strlen($token[1]) >= 7 && substr_compare($token[1], 'message', -7, 7, true) === 0; // Fill array for finding token offsets quickly. if (in_array($token[0], array(T_STRING, T_DOC_COMMENT)) || ($token[0] == T_VARIABLE && $token[1] == '$t') || $constraint_match) {