Issue #15398 has been updated by Daniel Pittman.

Assignee deleted (Daniel Pittman)

----------------------------------------
Bug #15398: Typo in regex makes wrong values accepted as float
https://projects.puppetlabs.com/issues/15398#change-92335

* Author: Pieter van de Bruggen
* Status: Closed
* Priority: High
* Assignee: 
* Category: language
* Target version: 3.0.0
* Affected Puppet version: 
* Keywords: 
* Branch: https://github.com/puppetlabs/puppet/pull/908
----------------------------------------
Puppet::Parser::Scope.number? checks if a string matches 
/–?\d+(:?.\d+|(:?.\d+)?e\d+)$/ and calls to_f on it if so. The regex should 
rather be /–?\d+(?:.\d+|(?:.\d+)?e\d+)$/, swapping ‘:’ and ‘?’ to use non 
capturing groups.

The current implementation will accept “3.:14”, and cast it into 3.0. Note that 
all numbers that should be accepted are dutifully accepted.

Introducing commit is 
https://github.com/puppetlabs/puppet/blob/cfa230a2d7b0c5e57cc0379785bd2025520f1c35/lib/puppet/parser/scope.rb#L53

(Originally reported as #15396)


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to