Browse Source

added sftp to url()

mattpotts 14 years ago
parent
commit
1c645152ca
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Cake/Utility/Validation.php

+ 1 - 1
lib/Cake/Utility/Validation.php

@@ -702,7 +702,7 @@ class Validation {
 	public static function url($check, $strict = false) {
 		self::_populateIp();
 		$validChars = '([' . preg_quote('!"$&\'()*+,-.@_:;=~[]') . '\/0-9a-z\p{L}\p{N}]|(%[0-9a-f]{2}))';
-		$regex = '/^(?:(?:https?|ftps?|file|news|gopher):\/\/)' . (!empty($strict) ? '' : '?') .
+		$regex = '/^(?:(?:https?|ftps?|sftp|file|news|gopher):\/\/)' . (!empty($strict) ? '' : '?') .
 			'(?:' . self::$_pattern['IPv4'] . '|\[' . self::$_pattern['IPv6'] . '\]|' . self::$_pattern['hostname'] . ')(?::[1-9][0-9]{0,4})?' .
 			'(?:\/?|\/' . $validChars . '*)?' .
 			'(?:\?' . $validChars . '*)?' .