From 695185e62e3f02960d173f8a6ac38f0182760e51 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 15 Jul 2015 07:43:08 -0400 Subject: [PATCH] Duration: No longer accepts 123e456d as a duration - Prohibits the use of [eE] in the units. - Permits use of [+-] only in the first position. --- src/Duration.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Duration.cpp b/src/Duration.cpp index f3d8b9127..0d7b0bbfe 100644 --- a/src/Duration.cpp +++ b/src/Duration.cpp @@ -332,7 +332,11 @@ bool Duration::parse (const std::string& input, std::string::size_type& start) } } - else if (n.getNumber (number)) + else if (n.getNumber (number) && + number.find ('e') == std::string::npos && + number.find ('E') == std::string::npos && + (number.find ('+') == std::string::npos || number.find ('+') == 0) && + (number.find ('-') == std::string::npos || number.find ('-') == 0)) { n.skipWS (); if (n.getOneOf (units, unit))