Changeset 1647 in ExiteCMS for trunk/includes/core_functions.php
- Timestamp:
- 08/17/08 14:48:04 (4 years ago)
- File:
-
- 1 edited
-
trunk/includes/core_functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/core_functions.php
r1645 r1647 374 374 375 375 // validate an URL 376 function isURL($value, $onlyhttp=false ) {376 function isURL($value, $onlyhttp=false, $schemereq=false) { 377 377 378 378 // Build the regex to check the URL … … 382 382 $scheme = "(https?|s?ftp|mailto|svn|cvs|callto|mms|skype)\:\/\/"; // ALL SCHEMES supported 383 383 } 384 $urlregex = "^(".$scheme.")?"; // make the scheme optional 384 if ($schemereq) { 385 $urlregex = "^(".$scheme.")"; // scheme 386 } else { 387 $urlregex = "^(".$scheme.")?"; // scheme (optional) 388 } 385 389 $urlregex .= "([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)?"; // USERID + PASSWORD (optional) 386 390 $urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)*"; // HOSTNAME or IP … … 711 715 function verify_image($file) { 712 716 $image_safe = true; 713 if ( file_exists($file)) {717 if (isURL($file, false, true) || file_exists($file)) { 714 718 $er = error_reporting(0); 715 719 // get info about the image
Note: See TracChangeset
for help on using the changeset viewer.
