Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#64347] remove falsy dot from token pattern

Tobias Dillmannbdf05da508b5
diff --git a/app/models/custom_field/calculated_value.rb b/app/models/custom_field/calculated_value.rb
index dd70e5ebf65..58b088ae4bb 100644
--- a/app/models/custom_field/calculated_value.rb
+++ b/app/models/custom_field/calculated_value.rb
@@ -72,7 +72,7 @@ module CustomField::CalculatedValue
# it prevents built-in functions from being used in the formula, which we do not want to allow.
allowed_chars = %w[+ - / * ( )] + [" "]
split_pattern = /\s|(\+)|(-)|(\/)|(\*)|(\()|(\))/
- allowed_tokens = /^(cf_\d+|\d+\.?\d*|\.\d+.|[#{allowed_chars.join}]+)$/
+ allowed_tokens = /^(cf_\d+|\d+\.?\d*|\.\d+|[#{allowed_chars.join}]+)$/
formula_string.split(split_pattern).reject(&:empty?).all? do |token|
token.match?(allowed_tokens)