View Issue Details

This bug affects 1 person(s).
 22
IDProjectCategoryView StatusLast Update
11894Bug reportsSurvey editingpublic2017-01-06 12:15
Reporteruniversewater Assigned Tomarkusfluer 
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Fixed in Version2.56.x 
Summary11894: Regex validation not working as expected when leading zeros are present in short text questions
Description

Consider a short text question with this validation: /^([0-9][0-9a-zA-Z][0-9a-zA-Z][0-9])$/ . You will not be able to input 0000 or 0111. If you remove the leading zeros all works as expected.

Steps To Reproduce
  1. Create a new short text question
  2. Set maximum characters to four (not really necessary)
  3. Input regex in validation:
    /^([0-9][0-9a-zA-Z][0-9a-zA-Z][0-9])$/
  4. You won't be able to submit 0000 or 0111
TagsNo tags attached.
Bug heat22
Complete LimeSurvey version number (& build)2.55.2+161103
I will donate to the project if issue is resolvedNo
Browser
Database type & versionNA
Server OS (if known)NA
Webserver software & version (if known)NA
PHP VersionNA

Relationships

related to 11731 closedollehar JavaScript error when the field has a validation regexp, and the input starts with a plus sign 
related to 10860 closedDenisChenu Regular expression fail (2.06+) 
related to 09242 closedmarkusfluer PHP and JS difference with numeric value starting by 0 
has duplicate 11830 closedmarkusfluer I see the danger text red color but not turns to green color. But I can step 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2016-11-13 17:33

developer   ~41867

Able to submit : only js error.

@markusfluer : for non numeric value we must control (before) if updated it's same or not than value.
https://github.com/LimeSurvey/LimeSurvey/commit/16a9571276661c86c39b9c22a3206743b821f2db#diff-7bbc2d713569df2d0d3341beed3ba2e0R739

markusfluer

markusfluer

2016-12-05 17:14

administrator   ~42375

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=21698

c_schmitz

c_schmitz

2017-01-06 12:15

administrator   ~42660

New version released.

Related Changesets

LimeSurvey: master 6906d1c0

2016-12-05 18:14

markusfluer


Details Diff
Fixed issue 11894: Regex validation not working as expected when leading zeros are present in short text questions Affected Issues
11894
mod - scripts/expressions/em_javascript.js Diff File

Issue History

Date Modified Username Field Change
2016-11-11 14:15 universewater New Issue
2016-11-13 17:20 DenisChenu Relationship added related to 11731
2016-11-13 17:21 DenisChenu Relationship added related to 10860
2016-11-13 17:22 DenisChenu Relationship added related to 09242
2016-11-13 17:33 DenisChenu Note Added: 41867
2016-11-14 15:23 LouisGac Assigned To => markusfluer
2016-11-14 15:23 LouisGac Status new => assigned
2016-11-14 16:44 DenisChenu Relationship added has duplicate 11830
2016-12-05 17:14 markusfluer Changeset attached => LimeSurvey master 6906d1c0
2016-12-05 17:14 markusfluer Note Added: 42375
2016-12-05 17:14 markusfluer Resolution open => fixed
2016-12-05 17:15 markusfluer Status assigned => resolved
2016-12-05 17:15 markusfluer Fixed in Version => 2.56.x
2017-01-06 12:15 c_schmitz Note Added: 42660
2017-01-06 12:15 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing
2021-08-02 19:34 guest Bug heat 18 => 22