File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
adm_program/system/classes Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -182,8 +182,8 @@ public static function strValidCharacters($string, $checkType)
182182 $ validRegex = '=^[^/?*;:~<>|\" \\\\]+$= ' ;
183183 break ;
184184 case 'url ' :
185- // $validRegex = '/^[\wáàâåäæçéèêîñóòôöõøœúùûüß$&!?() \/%=#:~.@+-]+$/i';
186- $ validRegex = '/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i ' ;
185+ $ validRegex = '/^[\wáàâåäæçéèêîñóòôöõøœúùûüß$&!?() \/%=#:~.@+-]+$/i ' ;
186+ $ validRegexValidUrl = '/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i ' ;
187187 break ;
188188 case 'phone ' :
189189 $ validRegex = '/^[\d() \/+-]+$/i ' ;
@@ -203,6 +203,11 @@ public static function strValidCharacters($string, $checkType)
203203 case 'email ' :
204204 return filter_var (trim ($ string ), FILTER_VALIDATE_EMAIL ) !== false ;
205205 case 'url ' :
206+ // url has a valid structure
207+ if (!preg_match ($ validRegexValidUrl , $ string )) {
208+ return false ;
209+ }
210+
206211 return filter_var (trim ($ string ), FILTER_VALIDATE_URL ) !== false ;
207212 default :
208213 return true ;
You can’t perform that action at this time.
0 commit comments