summaryrefslogtreecommitdiffstats
path: root/system/libraries/Validation.php
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-08 09:21:12 +0200
committeradmin <devnull@localhost>2006-10-08 09:21:12 +0200
commit10c3f41cbe5bd3bb66fd106cc9fb171ffcc7364b (patch)
tree7477d21d33dd07221425685756561c3bbd386217 /system/libraries/Validation.php
parent86d4e993d9ea21f28124b80f3d0c161aea681cb6 (diff)
Diffstat (limited to 'system/libraries/Validation.php')
-rw-r--r--system/libraries/Validation.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php
index 5322be0e9..07ca35a33 100644
--- a/system/libraries/Validation.php
+++ b/system/libraries/Validation.php
@@ -478,7 +478,21 @@ class CI_Validation {
{
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
}
+
+ // --------------------------------------------------------------------
+ /**
+ * Validate IP Address
+ *
+ * @access public
+ * @param string
+ * @return string
+ */
+ function valid_ip($ip)
+ {
+ return ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) ? FALSE : TRUE;
+ }
+
// --------------------------------------------------------------------
/**