File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 4242$ lang ['form_validation_valid_email ' ] = 'The {field} field must contain a valid email address. ' ;
4343$ lang ['form_validation_valid_emails ' ] = 'The {field} field must contain all valid email addresses. ' ;
4444$ lang ['form_validation_valid_url ' ] = 'The {field} field must contain a valid URL. ' ;
45+ $ lang ['form_validation_valid_human_url ' ] = 'The {field} field must contain a valid URL. ' ;
4546$ lang ['form_validation_valid_ip ' ] = 'The {field} field must contain a valid IP. ' ;
4647$ lang ['form_validation_valid_base64 ' ] = 'The {field} field must contain a valid Base64 string. ' ;
4748$ lang ['form_validation_min_length ' ] = 'The {field} field must be at least {param} characters in length. ' ;
Original file line number Diff line number Diff line change @@ -2043,6 +2043,25 @@ public function valid_url($str)
20432043
20442044 // --------------------------------------------------------------------
20452045
2046+ /**
2047+ * Valid Human URL
2048+ *
2049+ * @param string $str
2050+ * @return bool
2051+ */
2052+ public function valid_human_url ($ str )
2053+ {
2054+ $ pattern = "/^(?:(?:https?|ftp):\/\/)?(?:www\.)?([^\s\/$.?#].[^\s]*)$/i " ;
2055+
2056+ if (!preg_match ($ pattern , $ str )) {
2057+ return false ;
2058+ }
2059+
2060+ return true ;
2061+ }
2062+
2063+ // --------------------------------------------------------------------
2064+
20462065 /**
20472066 * Valid Email
20482067 *
You can’t perform that action at this time.
0 commit comments