Ignore:
Timestamp:
08/03/12 19:02:24 (7 years ago)
Author:
mistic100
Message:

feature 2380: add URL for user comment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r15598 r17351  
    16931693  return $is_mobile_theme; 
    16941694} 
     1695 
     1696/** 
     1697 * check url format 
     1698 */ 
     1699function url_check_format($url) 
     1700{ 
     1701  if (version_compare(PHP_VERSION, '5.2.0') >= 0) 
     1702  { 
     1703    return filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)!==false; 
     1704  } 
     1705  else 
     1706  { 
     1707    // http://mathiasbynens.be/demo/url-regex @imme_emosol 
     1708    return (bool)preg_match('@^https?://(-\.)?([^\s/?\.#-]+\.?)+(/[^\s]*)?$@iS', $url); 
     1709  } 
     1710} 
    16951711?> 
Note: See TracChangeset for help on using the changeset viewer.