View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
09602Bug reportsExpression Managerpublic2015-04-15 14:57
Reportercr80 Assigned ToDenisChenu  
PriorityhighSeverityminor 
Status closedResolutionno change required 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary09602: REGEX - error on the use of regular expressions
Description

Leading zeros are being ignored by Expression manager in numeric questions when the input value has more than one character. (I see the same with a short-text question set to "Numbers only")

Steps To Reproduce

See the file zip ErrorREGEX.zip. Two example (phone number and SIRET).

not right when the string begin with the number 0. Example : 0324568974
0320897454
You must add one number and the regex validation is OK.

With number 1 to 9 is OK.

Similarly for the number siret

TagsNo tags attached.
Attached Files
ErrorREGEX.zip (1,427 bytes)
Bug heat4
Complete LimeSurvey version number (& build)Version 2.05+ Build 150211
I will donate to the project if issue is resolvedNo
BrowserFireFox 36.0.4
Database type & versionMySQL 5.5.38
Server OS (if known)Linux Debian 6 (Squeeze)
Webserver software & version (if known)Apache 2.2.*
PHP Versionphp 5.4.3
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2015-04-15 09:24

developer   ~31998

Last edited: 2015-04-15 09:27

If you put 567 it' saved 0000000567.00000 in database,

000 is more a text than a number, 000==0. Using TEXT question type is OK.

I think it's a Not fix issue

Assigned to Tony : https://www.limesurvey.org/en/forum/can-i-do-this-with-limesurvey/100039-expressions-r%C3%A9guli%C3%A8res

tpartner

tpartner

2015-04-15 12:31

partner   ~31999

0123 IS a number.

tpartner

tpartner

2015-04-15 12:35

partner   ~32000

Furthermore, "Using TEXT question type" is not okay. If you set a short-text to "Numbers only", the same problem appears. How can one limit a question to numerics and allow leading zeros?

DenisChenu

DenisChenu

2015-04-15 14:07

developer   ~32001

Last edited: 2015-04-15 14:08

You can review the javascript : but there are a DB issue.

You can use config too for JS : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/config/config-defaults.php#L623

But it's like Calc : Enter 0001 in a cell , enter : shown 1.

If you want to save 06 : it's must be a text.

With number : 06==6
With text "06"!="6"

ANd when we save a nulbre, we must save like a number.

tpartner

tpartner

2015-04-15 14:17

partner   ~32002

I disagree. If the character is allowed to be input, the data should reflect EXACTLY what was input.

DenisChenu

DenisChenu

2015-04-15 14:57

developer   ~32003

Then close it, because same in PHP:
preg_match ('/^[0-9]{2}$/",01) is false

Look at : http://www.sondages.pro/brouillon/

Not a bug : a number don't have leading 0.

Issue History

Date Modified Username Field Change
2015-04-14 14:28 cr80 New Issue
2015-04-14 14:28 cr80 File Added: ErrorREGEX.zip
2015-04-15 09:24 DenisChenu Note Added: 31998
2015-04-15 09:26 DenisChenu Assigned To => tpartner
2015-04-15 09:26 DenisChenu Status new => assigned
2015-04-15 09:27 DenisChenu Note Edited: 31998
2015-04-15 09:27 DenisChenu Note Edited: 31998
2015-04-15 12:31 tpartner Note Added: 31999
2015-04-15 12:31 tpartner Assigned To tpartner => DenisChenu
2015-04-15 12:35 tpartner Note Added: 32000
2015-04-15 14:07 DenisChenu Note Added: 32001
2015-04-15 14:08 DenisChenu Note Edited: 32001
2015-04-15 14:17 tpartner Note Added: 32002
2015-04-15 14:57 DenisChenu Note Added: 32003
2015-04-15 14:57 DenisChenu Status assigned => closed
2015-04-15 14:57 DenisChenu Resolution open => no change required
2015-04-15 14:57 DenisChenu Fixed in Version => 2.05+