Skip to content

Commit

Permalink
[fix] #11509: numerical input option integer only leads to positive i…
Browse files Browse the repository at this point in the history
…nteger input only
  • Loading branch information
Shnoulle committed Aug 1, 2016
1 parent 072b66a commit 62ce8fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,11 @@
# Change Log
Only partial changelog, [commit history](https://framagit.org/Shnoulle/LimeSurvey/commits/2.06_SondagesPro) show all changelog.

## unreleased

### Fix
- Fixed issue #11509: numerical input option integer only leads to positive integer input only

## [1.0.23] - 2016-07-17

### Feature
Expand Down
5 changes: 4 additions & 1 deletion application/helpers/expressions/em_core_helper.php
Expand Up @@ -2744,9 +2744,12 @@ function exprmgr_if($test,$ok,$error)
function exprmgr_int($arg)
{
if(strpos($arg,"."))
{
$arg=preg_replace("/\.$/","",rtrim(strval($arg),"0"));// DECIMAL from SQL return always .00000000, the remove all 0 and one . , see #09550
return (ctype_digit($arg));// Accept empty value too before PHP 5.1 see http://php.net/ctype-digit#refsect1-function.ctype-digit-changelog
}
return (preg_match("/^-?[0-9]*$/",$arg));// Allow 000 for value, @link https://bugs.limesurvey.org/view.php?id=9550 DECIMAL sql type.
}

/**
* Join together $args[0-N] with ', '
* @param <type> $args
Expand Down

0 comments on commit 62ce8fb

Please sign in to comment.