Bug Report #2952

Validate::digit() should not allow negative integers

Added by Geert De Deckere about 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:06/11/2010
Priority:NormalDue date:
Assignee:Jeremy Bush% Done:

100%

Category:Core
Target version:v3.0.7
Resolution:fixed Points:

Description

Validate::digit() checks whether a string consists of digits only (no dots or dashes). However, if you are not enabling UTF-8 compatibility all that happens is an is_int check. (If you pass a string ctype_digit correctly disallows dashes.)

Validate::digit(-5);   // TRUE, should be FALSE
Validate::digit('-5'); // FALSE

Associated revisions

History

#1 Updated by Geert De Deckere about 4 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

#2 Updated by Matt Button about 4 years ago

Please can you set the status to "needs tests"? This could be a useful candidate

#3 Updated by Jeremy Bush about 4 years ago

  • Status changed from Closed to Needs Test
  • Assignee changed from Geert De Deckere to Jeremy Bush
  • Resolution deleted (fixed)

#4 Updated by Jeremy Bush about 4 years ago

  • Status changed from Needs Test to Closed
  • Resolution set to fixed

#5 Updated by Jeremy Bush about 4 years ago

  • % Done changed from 0 to 100

Also available in: Atom PDF