WYSIJA_help_validation

The MailPoet Newsletters WYSIJA help validation class.

Defined (1)

The class is defined in the following location(s).

/helpers/validation.php  
  1. class WYSIJA_help_validation extends WYSIJA_object { 
  2.  
  3. function __construct() { 
  4. parent::__construct(); 
  5.  
  6. /** 
  7. * Validate if a string is an URL 
  8. * @param string $url 
  9. * @return boolean 
  10. *  
  11. * Refer: http://www.krio.me/how-to-validate-a-url-php/ 
  12. */ 
  13. function isUrl($url) { 
  14. $pattern = "/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i"; 
  15. return (bool)preg_match($pattern, $url);