6.0.0-alpha12
6/14/25

[#12612] > This will break with $year is not a string type. ctype_int *requires* > the input value to be typed as a string and will return unexpected > results when it is passed an integer (as the phpdoc says this method > takes). oh, thanks for catching this.
Summary > This will break with $year is not a string type. ctype_int *requires* > the input value to be typed as a string and will return unexpected > results when it is passed an integer (as the phpdoc says this method > takes). oh, thanks for catching this.
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester thomas.jarosch (at) intra2net (dot) com
Created 08/24/2013 (4312 days ago)
Due
Updated 08/26/2013 (4310 days ago)
Assigned 08/24/2013 (4312 days ago)
Resolved 08/24/2013 (4312 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
08/26/2013 11:01:10 AM Jan Schneider Comment #4 Reply to this comment
Plus, ctype is another dependency and can be disabled in PHP. PCRE can't.
08/24/2013 07:49:37 PM Thomas Jarosch Comment #3
Summary ⇒ > This will break with $year is not a string type. ctype_int *requires* > the input value to be typed as a string and will return unexpected > results when it is passed an integer (as the phpdoc says this method > takes). oh, thanks for catching this.
State ⇒ Not A Bug
Reply to this comment
This will break with $year is not a string type. ctype_int 
*requires* the input value to be typed as a string and will return 
unexpected results when it is passed an integer (as the phpdoc says 
this method takes).
oh, thanks for catching this. The doc even says "may not return the 
expected result.".
$year must be explicitly cast to string before being passed to 
ctype_int If indeed it is more efficient than to just use the simple 
regex.
I measured the first part of the function with 10.000.000 invocations.
The speed gain is 0.1s -> Not worth the trouble.

08/24/2013 06:47:06 PM Michael Rubinsky Comment #2
State ⇒ Feedback
Reply to this comment
This will break with $year is not a string type. ctype_int *requires* 
the input value to be typed as a string and will return unexpected 
results when it is passed an integer (as the phpdoc says this method 
takes).

$year must be explicitly cast to string before being passed to 
ctype_int If indeed it is more efficient than to just use the simple 
regex.
08/24/2013 06:05:32 PM Thomas Jarosch Comment #1
Priority ⇒ 1. Low
New Attachment: 0001-Replace-simple-regex-with-ctype_digit.patch Download
Patch ⇒ Yes
Milestone ⇒
Summary ⇒ Horde_Date: Replace simple regex with ctype_digit()
Type ⇒ Bug
State ⇒ Unconfirmed
Queue ⇒ Horde Framework Packages
Reply to this comment
Simple patch attached.

Saved Queries