Ejemplo n.º 1
0
 /**
  * Check if an URL is valid for a page. Optionally check for duplicate URLs too.
  * @param string $url
  * @param boolean $allow_dups
  * @return false|string
  */
 public function validateURL($url, $allow_dups = false, $key = 'url')
 {
     # Dup checker
     if (!$allow_dups) {
         if (false !== GWF_Page::getByURL($url)) {
             return $this->lang('err_dup_url');
         }
     }
     # Sanitize URL
     $_POST[$key] = $url = ltrim(trim($url), '/');
     # Just some length check
     return GWF_Validator::validateString($this, $key, $url, 4, 255, false);
 }