added some extra protection in ctype_ function overrides to make return values match PHP's native methods for non-string types and empty strings
diff --git a/system/codeigniter/Compat.php b/system/codeigniter/Compat.php
index 3c5f70d..108b0a1 100644
--- a/system/codeigniter/Compat.php
+++ b/system/codeigniter/Compat.php
@@ -55,6 +55,11 @@
{
function ctype_digit($str)
{
+ if (! is_string($str) OR $str == '')
+ {
+ return FALSE;
+ }
+
return ! preg_match('/[^0-9]/', $str);
}
}
@@ -75,6 +80,11 @@
{
function ctype_alnum($str)
{
+ if (! is_string($str) OR $str == '')
+ {
+ return FALSE;
+ }
+
return ! preg_match('/[^0-9a-z]/i', $str);
}
}