Example #1
0
 /**
  * Validate URL
  *
  * @param   string   URL
  * @param   bool     allow idna/unicode urls
  * @return  boolean
  */
 public static function url($url, $idna = TRUE)
 {
     if ($idna) {
         $url = IDNA_convert::singleton()->encode($url);
     }
     return $url and (bool) filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED);
 }
Example #2
0
 /**
  * the constructor
  *
  * @param array $options
  * @return boolean
  * @since 0.5.2
  */
 public function __construct($options = false)
 {
     $this->slast = $this->_sbase + $this->_lcount * $this->_vcount * $this->_tcount;
     // If parameters are given, pass these to the respective method
     if (is_array($options)) {
         $this->set_parameter($options);
     }
     // populate mbstring overloading cache if not set
     if (self::$_mb_string_overload === null) {
         self::$_mb_string_overload = extension_loaded('mbstring') && (ini_get('mbstring.func_overload') & 0x2) === 0x2;
     }
 }