Changeset 1647 in ExiteCMS
- Timestamp:
- 08/17/08 14:48:04 (3 years ago)
- Location:
- trunk/includes
- Files:
-
- 2 edited
-
core_functions.php (modified) (3 diffs)
-
forum_functions_include.php (modified) (2 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 -
trunk/includes/forum_functions_include.php
r1598 r1647 447 447 $rawmsg = preg_replace_callback('#\[url(=.*?)\](.*?)([\r\n]*)\[/url\]#si', '_parseubb_urlblock', $rawmsg); 448 448 449 // strip IMG bbcode 450 $rawmsg = preg_replace_callback('#\[img\](.*?)([\r\n]*)\[/img\]#si', '_parseubb_imgblock', $rawmsg); 451 449 452 // find other URL's in the text, strip them and add them to $urlblocks for conversion to [URL] bbcodes 450 453 $rawmsg = preg_replace_callback('#(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&%\$\-]+)*@)?((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|(localhost)|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.[a-zA-Z]{2,4})(\:[0-9]+)?(/[^/][a-zA-Z0-9\.\,\?\'\\/\+&%\$\#\:\*\=~_\-@]*)*#si', '_parseubb_texturls', $rawmsg); … … 452 455 // convert any newlines to html <br> 453 456 $rawmsg = nl2br($rawmsg); 454 455 // strip IMG bbcode456 $rawmsg = preg_replace_callback('#\[img\](.*?)([\r\n]*)\[/img\]#si', '_parseubb_imgblock', $rawmsg);457 457 458 458 // detect and convert wikitags to wiki bbcodes if needed
Note: See TracChangeset
for help on using the changeset viewer.
