Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobocoder <anthon.pang@gmail.com>2011-01-10 21:50:50 +0300
committerrobocoder <anthon.pang@gmail.com>2011-01-10 21:50:50 +0300
commit7191afd6d6bb443708886bb013a4155271ce40d3 (patch)
tree3d1228f9d062d31354836f629c825ec7bedb88d3 /libs/Zend/Validate
parentbae316c9500f56f78aa7b1c596d9ef38b8b50231 (diff)
fixes #1765 - updating to Zend Framework 1.11.2 with some modifications:
ZF-10888: loadClass() inconsistencies * Zend/Http/Client.php * Zend/Uri.php * Zend/Validate.php ZF-10890: include_path dependency and inconsistencies * Zend/Validate/Hostname.php refs #160 - added Zend_OpenId git-svn-id: http://dev.piwik.org/svn/trunk@3694 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'libs/Zend/Validate')
-rw-r--r--libs/Zend/Validate/Abstract.php2
-rw-r--r--libs/Zend/Validate/Alnum.php4
-rw-r--r--libs/Zend/Validate/Alpha.php4
-rw-r--r--libs/Zend/Validate/Barcode.php4
-rw-r--r--libs/Zend/Validate/Barcode/AdapterAbstract.php2
-rw-r--r--libs/Zend/Validate/Barcode/AdapterInterface.php2
-rw-r--r--libs/Zend/Validate/Barcode/Code25.php2
-rw-r--r--libs/Zend/Validate/Barcode/Code25interleaved.php2
-rw-r--r--libs/Zend/Validate/Barcode/Code39.php2
-rw-r--r--libs/Zend/Validate/Barcode/Code39ext.php2
-rw-r--r--libs/Zend/Validate/Barcode/Code93.php2
-rw-r--r--libs/Zend/Validate/Barcode/Code93ext.php2
-rw-r--r--libs/Zend/Validate/Barcode/Ean12.php2
-rw-r--r--libs/Zend/Validate/Barcode/Ean14.php2
-rw-r--r--libs/Zend/Validate/Barcode/Ean18.php2
-rw-r--r--libs/Zend/Validate/Barcode/Ean2.php2
-rw-r--r--libs/Zend/Validate/Barcode/Ean5.php2
-rw-r--r--libs/Zend/Validate/Barcode/Ean8.php2
-rw-r--r--libs/Zend/Validate/Barcode/Gtin12.php2
-rw-r--r--libs/Zend/Validate/Barcode/Gtin13.php2
-rw-r--r--libs/Zend/Validate/Barcode/Gtin14.php2
-rw-r--r--libs/Zend/Validate/Barcode/Identcode.php2
-rw-r--r--libs/Zend/Validate/Barcode/Intelligentmail.php2
-rw-r--r--libs/Zend/Validate/Barcode/Issn.php2
-rw-r--r--libs/Zend/Validate/Barcode/Itf14.php2
-rw-r--r--libs/Zend/Validate/Barcode/Leitcode.php2
-rw-r--r--libs/Zend/Validate/Barcode/Planet.php2
-rw-r--r--libs/Zend/Validate/Barcode/Postnet.php2
-rw-r--r--libs/Zend/Validate/Barcode/Royalmail.php2
-rw-r--r--libs/Zend/Validate/Barcode/Sscc.php2
-rw-r--r--libs/Zend/Validate/Barcode/Upce.php2
-rw-r--r--libs/Zend/Validate/Callback.php4
-rw-r--r--libs/Zend/Validate/CreditCard.php10
-rw-r--r--libs/Zend/Validate/Date.php4
-rw-r--r--libs/Zend/Validate/Db/Abstract.php109
-rw-r--r--libs/Zend/Validate/Digits.php6
-rw-r--r--libs/Zend/Validate/EmailAddress.php6
-rw-r--r--libs/Zend/Validate/File/Count.php2
-rw-r--r--libs/Zend/Validate/File/Crc32.php4
-rw-r--r--libs/Zend/Validate/File/ExcludeExtension.php4
-rw-r--r--libs/Zend/Validate/File/ExcludeMimeType.php2
-rw-r--r--libs/Zend/Validate/File/Exists.php2
-rw-r--r--libs/Zend/Validate/File/Extension.php4
-rw-r--r--libs/Zend/Validate/File/FilesSize.php2
-rw-r--r--libs/Zend/Validate/File/Hash.php4
-rw-r--r--libs/Zend/Validate/File/ImageSize.php4
-rw-r--r--libs/Zend/Validate/File/IsCompressed.php6
-rw-r--r--libs/Zend/Validate/File/IsImage.php4
-rw-r--r--libs/Zend/Validate/File/Md5.php4
-rw-r--r--libs/Zend/Validate/File/MimeType.php6
-rw-r--r--libs/Zend/Validate/File/NotExists.php2
-rw-r--r--libs/Zend/Validate/File/Sha1.php4
-rw-r--r--libs/Zend/Validate/File/Size.php4
-rw-r--r--libs/Zend/Validate/File/Upload.php7
-rw-r--r--libs/Zend/Validate/File/WordCount.php4
-rw-r--r--libs/Zend/Validate/Float.php4
-rw-r--r--libs/Zend/Validate/GreaterThan.php2
-rw-r--r--libs/Zend/Validate/Hex.php4
-rw-r--r--libs/Zend/Validate/Hostname.php75
-rw-r--r--libs/Zend/Validate/Iban.php2
-rw-r--r--libs/Zend/Validate/Identical.php2
-rw-r--r--libs/Zend/Validate/InArray.php2
-rw-r--r--libs/Zend/Validate/Int.php4
-rw-r--r--libs/Zend/Validate/Interface.php4
-rw-r--r--libs/Zend/Validate/Ip.php4
-rw-r--r--libs/Zend/Validate/Isbn.php4
-rw-r--r--libs/Zend/Validate/NotEmpty.php4
-rw-r--r--libs/Zend/Validate/PostCode.php4
-rw-r--r--libs/Zend/Validate/Regex.php4
-rw-r--r--libs/Zend/Validate/Sitemap/Changefreq.php4
-rw-r--r--libs/Zend/Validate/Sitemap/Lastmod.php4
-rw-r--r--libs/Zend/Validate/Sitemap/Loc.php4
-rw-r--r--libs/Zend/Validate/Sitemap/Priority.php4
-rw-r--r--libs/Zend/Validate/StringLength.php4
74 files changed, 252 insertions, 163 deletions
diff --git a/libs/Zend/Validate/Abstract.php b/libs/Zend/Validate/Abstract.php
index a73185fd33..e31cc0ce49 100644
--- a/libs/Zend/Validate/Abstract.php
+++ b/libs/Zend/Validate/Abstract.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Abstract.php 22473 2010-06-20 08:30:04Z thomas $
+ * @version $Id: Abstract.php 22472 2010-06-20 07:36:16Z thomas $
*/
/**
diff --git a/libs/Zend/Validate/Alnum.php b/libs/Zend/Validate/Alnum.php
index 68ff74d6f0..025750ce10 100644
--- a/libs/Zend/Validate/Alnum.php
+++ b/libs/Zend/Validate/Alnum.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Alnum.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Alnum.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -57,7 +57,7 @@ class Zend_Validate_Alnum extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be float, string, or integer",
+ self::INVALID => "Invalid type given. String, integer or float expected",
self::NOT_ALNUM => "'%value%' contains characters which are non alphabetic and no digits",
self::STRING_EMPTY => "'%value%' is an empty string",
);
diff --git a/libs/Zend/Validate/Alpha.php b/libs/Zend/Validate/Alpha.php
index e82f17f823..be8e6f1197 100644
--- a/libs/Zend/Validate/Alpha.php
+++ b/libs/Zend/Validate/Alpha.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Alpha.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Alpha.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -57,7 +57,7 @@ class Zend_Validate_Alpha extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be a string",
+ self::INVALID => "Invalid type given. String expected",
self::NOT_ALPHA => "'%value%' contains non alphabetic characters",
self::STRING_EMPTY => "'%value%' is an empty string"
);
diff --git a/libs/Zend/Validate/Barcode.php b/libs/Zend/Validate/Barcode.php
index 8b0c7705fa..e8449c4342 100644
--- a/libs/Zend/Validate/Barcode.php
+++ b/libs/Zend/Validate/Barcode.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Barcode.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Barcode.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -46,7 +46,7 @@ class Zend_Validate_Barcode extends Zend_Validate_Abstract
self::FAILED => "'%value%' failed checksum validation",
self::INVALID_CHARS => "'%value%' contains invalid characters",
self::INVALID_LENGTH => "'%value%' should have a length of %length% characters",
- self::INVALID => "Invalid type given, value should be string",
+ self::INVALID => "Invalid type given. String expected",
);
/**
diff --git a/libs/Zend/Validate/Barcode/AdapterAbstract.php b/libs/Zend/Validate/Barcode/AdapterAbstract.php
index 7cbb4644f8..6c1b03c38f 100644
--- a/libs/Zend/Validate/Barcode/AdapterAbstract.php
+++ b/libs/Zend/Validate/Barcode/AdapterAbstract.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: AdapterAbstract.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/AdapterInterface.php b/libs/Zend/Validate/Barcode/AdapterInterface.php
index 325c6048f3..58b1f8bdb5 100644
--- a/libs/Zend/Validate/Barcode/AdapterInterface.php
+++ b/libs/Zend/Validate/Barcode/AdapterInterface.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: AdapterInterface.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Code25.php b/libs/Zend/Validate/Barcode/Code25.php
index 6d1525da4c..d042ab668a 100644
--- a/libs/Zend/Validate/Barcode/Code25.php
+++ b/libs/Zend/Validate/Barcode/Code25.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Code25.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Code25interleaved.php b/libs/Zend/Validate/Barcode/Code25interleaved.php
index 54fd90bd28..eae69c01d4 100644
--- a/libs/Zend/Validate/Barcode/Code25interleaved.php
+++ b/libs/Zend/Validate/Barcode/Code25interleaved.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Code25interleaved.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Code39.php b/libs/Zend/Validate/Barcode/Code39.php
index 8208cffb9e..0b0675bdc5 100644
--- a/libs/Zend/Validate/Barcode/Code39.php
+++ b/libs/Zend/Validate/Barcode/Code39.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Code39.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Code39ext.php b/libs/Zend/Validate/Barcode/Code39ext.php
index 5b90254c50..c3d0f52070 100644
--- a/libs/Zend/Validate/Barcode/Code39ext.php
+++ b/libs/Zend/Validate/Barcode/Code39ext.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Code39ext.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Code93.php b/libs/Zend/Validate/Barcode/Code93.php
index 36a6567f36..16b7639e72 100644
--- a/libs/Zend/Validate/Barcode/Code93.php
+++ b/libs/Zend/Validate/Barcode/Code93.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Code93.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Code93ext.php b/libs/Zend/Validate/Barcode/Code93ext.php
index 2aaf343162..78689ea509 100644
--- a/libs/Zend/Validate/Barcode/Code93ext.php
+++ b/libs/Zend/Validate/Barcode/Code93ext.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Code93ext.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Ean12.php b/libs/Zend/Validate/Barcode/Ean12.php
index 26dee47fb5..0694de36f5 100644
--- a/libs/Zend/Validate/Barcode/Ean12.php
+++ b/libs/Zend/Validate/Barcode/Ean12.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: Ean12.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Ean14.php b/libs/Zend/Validate/Barcode/Ean14.php
index 19756c8ee7..1d1bc992b9 100644
--- a/libs/Zend/Validate/Barcode/Ean14.php
+++ b/libs/Zend/Validate/Barcode/Ean14.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: Ean14.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Ean18.php b/libs/Zend/Validate/Barcode/Ean18.php
index 7c6519959f..59f35190a5 100644
--- a/libs/Zend/Validate/Barcode/Ean18.php
+++ b/libs/Zend/Validate/Barcode/Ean18.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: Ean18.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Ean2.php b/libs/Zend/Validate/Barcode/Ean2.php
index 009bfe5e57..fbb305ea4b 100644
--- a/libs/Zend/Validate/Barcode/Ean2.php
+++ b/libs/Zend/Validate/Barcode/Ean2.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Ean2.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Ean5.php b/libs/Zend/Validate/Barcode/Ean5.php
index 7574e897e4..5c88c47282 100644
--- a/libs/Zend/Validate/Barcode/Ean5.php
+++ b/libs/Zend/Validate/Barcode/Ean5.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Ean5.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Ean8.php b/libs/Zend/Validate/Barcode/Ean8.php
index ca68fe45d9..450df7b028 100644
--- a/libs/Zend/Validate/Barcode/Ean8.php
+++ b/libs/Zend/Validate/Barcode/Ean8.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Ean8.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Gtin12.php b/libs/Zend/Validate/Barcode/Gtin12.php
index 7453e05f64..516907a43d 100644
--- a/libs/Zend/Validate/Barcode/Gtin12.php
+++ b/libs/Zend/Validate/Barcode/Gtin12.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: Gtin12.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Gtin13.php b/libs/Zend/Validate/Barcode/Gtin13.php
index c466f5896a..22020e0cb9 100644
--- a/libs/Zend/Validate/Barcode/Gtin13.php
+++ b/libs/Zend/Validate/Barcode/Gtin13.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: Gtin13.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Gtin14.php b/libs/Zend/Validate/Barcode/Gtin14.php
index 7c5c1cdb5b..277ae06451 100644
--- a/libs/Zend/Validate/Barcode/Gtin14.php
+++ b/libs/Zend/Validate/Barcode/Gtin14.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: Gtin14.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Identcode.php b/libs/Zend/Validate/Barcode/Identcode.php
index 6899c17910..6cf666e648 100644
--- a/libs/Zend/Validate/Barcode/Identcode.php
+++ b/libs/Zend/Validate/Barcode/Identcode.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Identcode.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Intelligentmail.php b/libs/Zend/Validate/Barcode/Intelligentmail.php
index a0e81cfca6..51cca537e8 100644
--- a/libs/Zend/Validate/Barcode/Intelligentmail.php
+++ b/libs/Zend/Validate/Barcode/Intelligentmail.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Intelligentmail.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Issn.php b/libs/Zend/Validate/Barcode/Issn.php
index e9507c9a5f..abd1e188da 100644
--- a/libs/Zend/Validate/Barcode/Issn.php
+++ b/libs/Zend/Validate/Barcode/Issn.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Issn.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Itf14.php b/libs/Zend/Validate/Barcode/Itf14.php
index 10cfeb761c..c219a26701 100644
--- a/libs/Zend/Validate/Barcode/Itf14.php
+++ b/libs/Zend/Validate/Barcode/Itf14.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: Itf14.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Leitcode.php b/libs/Zend/Validate/Barcode/Leitcode.php
index 52f1fc0428..1f51a8c6f7 100644
--- a/libs/Zend/Validate/Barcode/Leitcode.php
+++ b/libs/Zend/Validate/Barcode/Leitcode.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Leitcode.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Planet.php b/libs/Zend/Validate/Barcode/Planet.php
index b4eaf66cb9..d7dad19496 100644
--- a/libs/Zend/Validate/Barcode/Planet.php
+++ b/libs/Zend/Validate/Barcode/Planet.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Planet.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Postnet.php b/libs/Zend/Validate/Barcode/Postnet.php
index 9d2ff879b8..730482f12b 100644
--- a/libs/Zend/Validate/Barcode/Postnet.php
+++ b/libs/Zend/Validate/Barcode/Postnet.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Postnet.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Royalmail.php b/libs/Zend/Validate/Barcode/Royalmail.php
index 0bcdf1e16c..b04ab9f79d 100644
--- a/libs/Zend/Validate/Barcode/Royalmail.php
+++ b/libs/Zend/Validate/Barcode/Royalmail.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id:$
+ * @version $Id: Royalmail.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Sscc.php b/libs/Zend/Validate/Barcode/Sscc.php
index b44b19a561..a7d01b2d88 100644
--- a/libs/Zend/Validate/Barcode/Sscc.php
+++ b/libs/Zend/Validate/Barcode/Sscc.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: Sscc.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Barcode/Upce.php b/libs/Zend/Validate/Barcode/Upce.php
index 3199f19b90..99eaee9328 100644
--- a/libs/Zend/Validate/Barcode/Upce.php
+++ b/libs/Zend/Validate/Barcode/Upce.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: UpcA.php 18028 2009-09-08 20:52:23Z thomas $
+ * @version $Id: Upce.php 20785 2010-01-31 09:43:03Z mikaelkael $
*/
/**
diff --git a/libs/Zend/Validate/Callback.php b/libs/Zend/Validate/Callback.php
index df12de08e6..a539ce948c 100644
--- a/libs/Zend/Validate/Callback.php
+++ b/libs/Zend/Validate/Callback.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Callback.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Callback.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -49,7 +49,7 @@ class Zend_Validate_Callback extends Zend_Validate_Abstract
*/
protected $_messageTemplates = array(
self::INVALID_VALUE => "'%value%' is not valid",
- self::INVALID_CALLBACK => "Failure within the callback, exception returned",
+ self::INVALID_CALLBACK => "An exception has been raised within the callback",
);
/**
diff --git a/libs/Zend/Validate/CreditCard.php b/libs/Zend/Validate/CreditCard.php
index c76fd11f8a..86ae383cf9 100644
--- a/libs/Zend/Validate/CreditCard.php
+++ b/libs/Zend/Validate/CreditCard.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: CreditCard.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: CreditCard.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -64,13 +64,13 @@ class Zend_Validate_CreditCard extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::CHECKSUM => "Luhn algorithm (mod-10 checksum) failed on '%value%'",
+ self::CHECKSUM => "'%value%' seems to contain an invalid checksum",
self::CONTENT => "'%value%' must contain only digits",
- self::INVALID => "Invalid type given, value should be a string",
+ self::INVALID => "Invalid type given. String expected",
self::LENGTH => "'%value%' contains an invalid amount of digits",
self::PREFIX => "'%value%' is not from an allowed institute",
- self::SERVICE => "Validation of '%value%' has been failed by the service",
- self::SERVICEFAILURE => "The service returned a failure while validating '%value%'",
+ self::SERVICE => "'%value%' seems to be an invalid creditcard number",
+ self::SERVICEFAILURE => "An exception has been raised while validating '%value%'",
);
/**
diff --git a/libs/Zend/Validate/Date.php b/libs/Zend/Validate/Date.php
index 1353f56c5f..bac24aabfc 100644
--- a/libs/Zend/Validate/Date.php
+++ b/libs/Zend/Validate/Date.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Date.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Date.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -42,7 +42,7 @@ class Zend_Validate_Date extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be string, integer, array or Zend_Date",
+ self::INVALID => "Invalid type given. String, integer, array or Zend_Date expected",
self::INVALID_DATE => "'%value%' does not appear to be a valid date",
self::FALSEFORMAT => "'%value%' does not fit the date format '%format%'",
);
diff --git a/libs/Zend/Validate/Db/Abstract.php b/libs/Zend/Validate/Db/Abstract.php
index 240b96c9f5..cdbfb37810 100644
--- a/libs/Zend/Validate/Db/Abstract.php
+++ b/libs/Zend/Validate/Db/Abstract.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Abstract.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Abstract.php 23484 2010-12-10 03:57:59Z mjh_ca $
*/
/**
@@ -45,8 +45,8 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract
* @var array Message templates
*/
protected $_messageTemplates = array(
- self::ERROR_NO_RECORD_FOUND => 'No record matching %value% was found',
- self::ERROR_RECORD_FOUND => 'A record matching %value% was found',
+ self::ERROR_NO_RECORD_FOUND => "No record matching '%value%' was found",
+ self::ERROR_RECORD_FOUND => "A record matching '%value%' was found",
);
/**
@@ -77,6 +77,12 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract
protected $_adapter = null;
/**
+ * Select object to use. can be set, or will be auto-generated
+ * @var Zend_Db_Select
+ */
+ protected $_select;
+
+ /**
* Provides basic configuration for use with Zend_Validate_Db Validators
* Setting $exclude allows a single record to be excluded from matching.
* Exclude can either be a String containing a where clause, or an array with `field` and `value` keys
@@ -94,6 +100,10 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract
*/
public function __construct($options)
{
+ if ($options instanceof Zend_Db_Select) {
+ $this->setSelect($options);
+ return;
+ }
if ($options instanceof Zend_Config) {
$options = $options->toArray();
} else if (func_num_args() > 1) {
@@ -146,6 +156,16 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract
*/
public function getAdapter()
{
+ /**
+ * Check for an adapter being defined. if not, fetch the default adapter.
+ */
+ if ($this->_adapter === null) {
+ $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
+ if (null === $this->_adapter) {
+ // require_once 'Zend/Validate/Exception.php';
+ throw new Zend_Validate_Exception('No database adapter present');
+ }
+ }
return $this->_adapter;
}
@@ -255,43 +275,76 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract
}
/**
- * Run query and returns matches, or null if no matches are found.
+ * Sets the select object to be used by the validator
*
- * @param String $value
- * @return Array when matches are found.
+ * @param Zend_Db_Select $select
+ * @return Zend_Validate_Db_Abstract
*/
- protected function _query($value)
+ public function setSelect($select)
{
- /**
- * Check for an adapter being defined. if not, fetch the default adapter.
- */
- if ($this->_adapter === null) {
- $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
- if (null === $this->_adapter) {
- // require_once 'Zend/Validate/Exception.php';
- throw new Zend_Validate_Exception('No database adapter present');
- }
+ if (!$select instanceof Zend_Db_Select) {
+ throw new Zend_Validate_Exception('Select option must be a valid ' .
+ 'Zend_Db_Select object');
}
+ $this->_select = $select;
+ return $this;
+ }
- /**
- * Build select object
- */
- $select = new Zend_Db_Select($this->_adapter);
- $select->from($this->_table, array($this->_field), $this->_schema)
- ->where($this->_adapter->quoteIdentifier($this->_field, true).' = ?', $value);
- if ($this->_exclude !== null) {
- if (is_array($this->_exclude)) {
- $select->where($this->_adapter->quoteIdentifier($this->_exclude['field'], true).' != ?', $this->_exclude['value']);
+ /**
+ * Gets the select object to be used by the validator.
+ * If no select object was supplied to the constructor,
+ * then it will auto-generate one from the given table,
+ * schema, field, and adapter options.
+ *
+ * @return Zend_Db_Select The Select object which will be used
+ */
+ public function getSelect()
+ {
+ if (null === $this->_select) {
+ $db = $this->getAdapter();
+ /**
+ * Build select object
+ */
+ $select = new Zend_Db_Select($db);
+ $select->from($this->_table, array($this->_field), $this->_schema);
+ if ($db->supportsParameters('named')) {
+ $select->where($db->quoteIdentifier($this->_field, true).' = :value'); // named
} else {
- $select->where($this->_exclude);
+ $select->where($db->quoteIdentifier($this->_field, true).' = ?'); // positional
+ }
+ if ($this->_exclude !== null) {
+ if (is_array($this->_exclude)) {
+ $select->where(
+ $db->quoteIdentifier($this->_exclude['field'], true) .
+ ' != ?', $this->_exclude['value']
+ );
+ } else {
+ $select->where($this->_exclude);
+ }
}
+ $select->limit(1);
+ $this->_select = $select;
}
- $select->limit(1);
+ return $this->_select;
+ }
+ /**
+ * Run query and returns matches, or null if no matches are found.
+ *
+ * @param String $value
+ * @return Array when matches are found.
+ */
+ protected function _query($value)
+ {
+ $select = $this->getSelect();
/**
* Run query
*/
- $result = $this->_adapter->fetchRow($select, array(), Zend_Db::FETCH_ASSOC);
+ $result = $select->getAdapter()->fetchRow(
+ $select,
+ array('value' => $value), // this should work whether db supports positional or named params
+ Zend_Db::FETCH_ASSOC
+ );
return $result;
}
diff --git a/libs/Zend/Validate/Digits.php b/libs/Zend/Validate/Digits.php
index da81750fb3..90ef7e4de5 100644
--- a/libs/Zend/Validate/Digits.php
+++ b/libs/Zend/Validate/Digits.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Digits.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Digits.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -49,9 +49,9 @@ class Zend_Validate_Digits extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::NOT_DIGITS => "'%value%' contains characters which are not digits; but only digits are allowed",
+ self::NOT_DIGITS => "'%value%' must contain only digits",
self::STRING_EMPTY => "'%value%' is an empty string",
- self::INVALID => "Invalid type given, value should be string, integer or float",
+ self::INVALID => "Invalid type given. String, integer or float expected",
);
/**
diff --git a/libs/Zend/Validate/EmailAddress.php b/libs/Zend/Validate/EmailAddress.php
index ad008b407d..3540da770a 100644
--- a/libs/Zend/Validate/EmailAddress.php
+++ b/libs/Zend/Validate/EmailAddress.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: EmailAddress.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: EmailAddress.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -51,11 +51,11 @@ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be a string",
+ self::INVALID => "Invalid type given. String expected",
self::INVALID_FORMAT => "'%value%' is no valid email address in the basic format local-part@hostname",
self::INVALID_HOSTNAME => "'%hostname%' is no valid hostname for email address '%value%'",
self::INVALID_MX_RECORD => "'%hostname%' does not appear to have a valid MX record for the email address '%value%'",
- self::INVALID_SEGMENT => "'%hostname%' is not in a routable network segment. The email address '%value%' should not be resolved from public network.",
+ self::INVALID_SEGMENT => "'%hostname%' is not in a routable network segment. The email address '%value%' should not be resolved from public network",
self::DOT_ATOM => "'%localPart%' can not be matched against dot-atom format",
self::QUOTED_STRING => "'%localPart%' can not be matched against quoted-string format",
self::INVALID_LOCAL_PART => "'%localPart%' is no valid local part for email address '%value%'",
diff --git a/libs/Zend/Validate/File/Count.php b/libs/Zend/Validate/File/Count.php
index a4bff7ee8c..a49a499a71 100644
--- a/libs/Zend/Validate/File/Count.php
+++ b/libs/Zend/Validate/File/Count.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Count.php 21326 2010-03-04 20:32:39Z thomas $
+ * @version $Id: Count.php 21325 2010-03-04 20:26:36Z thomas $
*/
/**
diff --git a/libs/Zend/Validate/File/Crc32.php b/libs/Zend/Validate/File/Crc32.php
index aef309353e..495f24ee49 100644
--- a/libs/Zend/Validate/File/Crc32.php
+++ b/libs/Zend/Validate/File/Crc32.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Crc32.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Crc32.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -47,7 +47,7 @@ class Zend_Validate_File_Crc32 extends Zend_Validate_File_Hash
protected $_messageTemplates = array(
self::DOES_NOT_MATCH => "File '%value%' does not match the given crc32 hashes",
self::NOT_DETECTED => "A crc32 hash could not be evaluated for the given file",
- self::NOT_FOUND => "File '%value%' could not be found",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
);
/**
diff --git a/libs/Zend/Validate/File/ExcludeExtension.php b/libs/Zend/Validate/File/ExcludeExtension.php
index 0bf2d5bdf9..8f8bb5c914 100644
--- a/libs/Zend/Validate/File/ExcludeExtension.php
+++ b/libs/Zend/Validate/File/ExcludeExtension.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: ExcludeExtension.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: ExcludeExtension.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -45,7 +45,7 @@ class Zend_Validate_File_ExcludeExtension extends Zend_Validate_File_Extension
*/
protected $_messageTemplates = array(
self::FALSE_EXTENSION => "File '%value%' has a false extension",
- self::NOT_FOUND => "File '%value%' could not be found",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
);
/**
diff --git a/libs/Zend/Validate/File/ExcludeMimeType.php b/libs/Zend/Validate/File/ExcludeMimeType.php
index 436caa1f02..24c1537fac 100644
--- a/libs/Zend/Validate/File/ExcludeMimeType.php
+++ b/libs/Zend/Validate/File/ExcludeMimeType.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: ExcludeMimeType.php 21936 2010-04-18 16:23:34Z thomas $
+ * @version $Id: ExcludeMimeType.php 21935 2010-04-18 16:21:35Z thomas $
*/
/**
diff --git a/libs/Zend/Validate/File/Exists.php b/libs/Zend/Validate/File/Exists.php
index 6ecd11f1f0..cef188dc28 100644
--- a/libs/Zend/Validate/File/Exists.php
+++ b/libs/Zend/Validate/File/Exists.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Exists.php 20358 2010-01-17 19:03:49Z thomas $
+ * @version $Id: Exists.php 20352 2010-01-17 17:55:38Z thomas $
*/
/**
diff --git a/libs/Zend/Validate/File/Extension.php b/libs/Zend/Validate/File/Extension.php
index b5e63a2e95..71985f5e9b 100644
--- a/libs/Zend/Validate/File/Extension.php
+++ b/libs/Zend/Validate/File/Extension.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Extension.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Extension.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -45,7 +45,7 @@ class Zend_Validate_File_Extension extends Zend_Validate_Abstract
*/
protected $_messageTemplates = array(
self::FALSE_EXTENSION => "File '%value%' has a false extension",
- self::NOT_FOUND => "File '%value%' could not be found",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
);
/**
diff --git a/libs/Zend/Validate/File/FilesSize.php b/libs/Zend/Validate/File/FilesSize.php
index ca20ad50af..a418ef3bb4 100644
--- a/libs/Zend/Validate/File/FilesSize.php
+++ b/libs/Zend/Validate/File/FilesSize.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: FilesSize.php 20455 2010-01-20 22:54:18Z thomas $
+ * @version $Id: FilesSize.php 20454 2010-01-20 22:50:59Z thomas $
*/
/**
diff --git a/libs/Zend/Validate/File/Hash.php b/libs/Zend/Validate/File/Hash.php
index 4b9772887c..2e4071b645 100644
--- a/libs/Zend/Validate/File/Hash.php
+++ b/libs/Zend/Validate/File/Hash.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Hash.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Hash.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -47,7 +47,7 @@ class Zend_Validate_File_Hash extends Zend_Validate_Abstract
protected $_messageTemplates = array(
self::DOES_NOT_MATCH => "File '%value%' does not match the given hashes",
self::NOT_DETECTED => "A hash could not be evaluated for the given file",
- self::NOT_FOUND => "File '%value%' could not be found"
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist"
);
/**
diff --git a/libs/Zend/Validate/File/ImageSize.php b/libs/Zend/Validate/File/ImageSize.php
index aa882a5b5d..4f2915d49e 100644
--- a/libs/Zend/Validate/File/ImageSize.php
+++ b/libs/Zend/Validate/File/ImageSize.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: ImageSize.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: ImageSize.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -53,7 +53,7 @@ class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract
self::HEIGHT_TOO_BIG => "Maximum allowed height for image '%value%' should be '%maxheight%' but '%height%' detected",
self::HEIGHT_TOO_SMALL => "Minimum expected height for image '%value%' should be '%minheight%' but '%height%' detected",
self::NOT_DETECTED => "The size of image '%value%' could not be detected",
- self::NOT_READABLE => "File '%value%' can not be read",
+ self::NOT_READABLE => "File '%value%' is not readable or does not exist",
);
/**
diff --git a/libs/Zend/Validate/File/IsCompressed.php b/libs/Zend/Validate/File/IsCompressed.php
index 30415e3229..b75fe481a1 100644
--- a/libs/Zend/Validate/File/IsCompressed.php
+++ b/libs/Zend/Validate/File/IsCompressed.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: IsCompressed.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: IsCompressed.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -46,8 +46,8 @@ class Zend_Validate_File_IsCompressed extends Zend_Validate_File_MimeType
*/
protected $_messageTemplates = array(
self::FALSE_TYPE => "File '%value%' is not compressed, '%type%' detected",
- self::NOT_DETECTED => "The mimetype of file '%value%' could not been detected",
- self::NOT_READABLE => "File '%value%' can not be read",
+ self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
+ self::NOT_READABLE => "File '%value%' is not readable or does not exist",
);
/**
diff --git a/libs/Zend/Validate/File/IsImage.php b/libs/Zend/Validate/File/IsImage.php
index 4fa966266f..3b91a71989 100644
--- a/libs/Zend/Validate/File/IsImage.php
+++ b/libs/Zend/Validate/File/IsImage.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: IsImage.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: IsImage.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -47,7 +47,7 @@ class Zend_Validate_File_IsImage extends Zend_Validate_File_MimeType
protected $_messageTemplates = array(
self::FALSE_TYPE => "File '%value%' is no image, '%type%' detected",
self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
- self::NOT_READABLE => "File '%value%' can not be read",
+ self::NOT_READABLE => "File '%value%' is not readable or does not exist",
);
/**
diff --git a/libs/Zend/Validate/File/Md5.php b/libs/Zend/Validate/File/Md5.php
index d2626ba638..52a28f6011 100644
--- a/libs/Zend/Validate/File/Md5.php
+++ b/libs/Zend/Validate/File/Md5.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Md5.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Md5.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -47,7 +47,7 @@ class Zend_Validate_File_Md5 extends Zend_Validate_File_Hash
protected $_messageTemplates = array(
self::DOES_NOT_MATCH => "File '%value%' does not match the given md5 hashes",
self::NOT_DETECTED => "A md5 hash could not be evaluated for the given file",
- self::NOT_FOUND => "File '%value%' could not be found",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
);
/**
diff --git a/libs/Zend/Validate/File/MimeType.php b/libs/Zend/Validate/File/MimeType.php
index 7bf1bfd0b1..8d26b17e02 100644
--- a/libs/Zend/Validate/File/MimeType.php
+++ b/libs/Zend/Validate/File/MimeType.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: MimeType.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: MimeType.php 22832 2010-08-12 18:02:41Z thomas $
*/
/**
@@ -48,7 +48,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract
protected $_messageTemplates = array(
self::FALSE_TYPE => "File '%value%' has a false mimetype of '%type%'",
self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
- self::NOT_READABLE => "File '%value%' can not be read",
+ self::NOT_READABLE => "File '%value%' is not readable or does not exist",
);
/**
@@ -191,7 +191,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract
$this->_magicfile = null;
// require_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception('Magicfile can not be set. There is no finfo extension installed');
- } else if (!is_readable($file)) {
+ } else if (!is_file($file) || !is_readable($file)) {
// require_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception('The given magicfile can not be read');
} else {
diff --git a/libs/Zend/Validate/File/NotExists.php b/libs/Zend/Validate/File/NotExists.php
index a5afe94686..869346f46d 100644
--- a/libs/Zend/Validate/File/NotExists.php
+++ b/libs/Zend/Validate/File/NotExists.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: NotExists.php 20358 2010-01-17 19:03:49Z thomas $
+ * @version $Id: NotExists.php 20352 2010-01-17 17:55:38Z thomas $
*/
/**
diff --git a/libs/Zend/Validate/File/Sha1.php b/libs/Zend/Validate/File/Sha1.php
index 8d3ee8a03d..3a8698a30e 100644
--- a/libs/Zend/Validate/File/Sha1.php
+++ b/libs/Zend/Validate/File/Sha1.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Sha1.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Sha1.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -47,7 +47,7 @@ class Zend_Validate_File_Sha1 extends Zend_Validate_File_Hash
protected $_messageTemplates = array(
self::DOES_NOT_MATCH => "File '%value%' does not match the given sha1 hashes",
self::NOT_DETECTED => "A sha1 hash could not be evaluated for the given file",
- self::NOT_FOUND => "File '%value%' could not be found",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
);
/**
diff --git a/libs/Zend/Validate/File/Size.php b/libs/Zend/Validate/File/Size.php
index 207a12356e..247f2965f9 100644
--- a/libs/Zend/Validate/File/Size.php
+++ b/libs/Zend/Validate/File/Size.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Size.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Size.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -48,7 +48,7 @@ class Zend_Validate_File_Size extends Zend_Validate_Abstract
protected $_messageTemplates = array(
self::TOO_BIG => "Maximum allowed size for file '%value%' is '%max%' but '%size%' detected",
self::TOO_SMALL => "Minimum expected size for file '%value%' is '%min%' but '%size%' detected",
- self::NOT_FOUND => "File '%value%' could not be found",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
);
/**
diff --git a/libs/Zend/Validate/File/Upload.php b/libs/Zend/Validate/File/Upload.php
index 92bbba59c3..0d01a4b566 100644
--- a/libs/Zend/Validate/File/Upload.php
+++ b/libs/Zend/Validate/File/Upload.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Upload.php 22399 2010-06-09 19:08:28Z thomas $
+ * @version $Id: Upload.php 23570 2010-12-20 08:38:30Z mjh_ca $
*/
/**
@@ -136,6 +136,11 @@ class Zend_Validate_File_Upload extends Zend_Validate_Abstract
$this->_files = $files;
}
+ // see ZF-10738
+ if (is_null($this->_files)) {
+ $this->_files = array();
+ }
+
foreach($this->_files as $file => $content) {
if (!isset($content['error'])) {
unset($this->_files[$file]);
diff --git a/libs/Zend/Validate/File/WordCount.php b/libs/Zend/Validate/File/WordCount.php
index 2d94bfa605..bb9364174a 100644
--- a/libs/Zend/Validate/File/WordCount.php
+++ b/libs/Zend/Validate/File/WordCount.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: WordCount.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: WordCount.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -48,7 +48,7 @@ class Zend_Validate_File_WordCount extends Zend_Validate_File_Count
protected $_messageTemplates = array(
self::TOO_MUCH => "Too much words, maximum '%max%' are allowed but '%count%' were counted",
self::TOO_LESS => "Too less words, minimum '%min%' are expected but '%count%' were counted",
- self::NOT_FOUND => "File '%value%' could not be found",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
);
/**
diff --git a/libs/Zend/Validate/Float.php b/libs/Zend/Validate/Float.php
index 067f24e28c..ac8fb7e6dd 100644
--- a/libs/Zend/Validate/Float.php
+++ b/libs/Zend/Validate/Float.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Float.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Float.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -44,7 +44,7 @@ class Zend_Validate_Float extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be float, string, or integer",
+ self::INVALID => "Invalid type given. String, integer or float expected",
self::NOT_FLOAT => "'%value%' does not appear to be a float",
);
diff --git a/libs/Zend/Validate/GreaterThan.php b/libs/Zend/Validate/GreaterThan.php
index a9b7a21879..7c313a0bf0 100644
--- a/libs/Zend/Validate/GreaterThan.php
+++ b/libs/Zend/Validate/GreaterThan.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: GreaterThan.php 20358 2010-01-17 19:03:49Z thomas $
+ * @version $Id: GreaterThan.php 20352 2010-01-17 17:55:38Z thomas $
*/
/**
diff --git a/libs/Zend/Validate/Hex.php b/libs/Zend/Validate/Hex.php
index bd8a39a449..999dc849f3 100644
--- a/libs/Zend/Validate/Hex.php
+++ b/libs/Zend/Validate/Hex.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Hex.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Hex.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -41,7 +41,7 @@ class Zend_Validate_Hex extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be a string",
+ self::INVALID => "Invalid type given. String expected",
self::NOT_HEX => "'%value%' has not only hexadecimal digit characters",
);
diff --git a/libs/Zend/Validate/Hostname.php b/libs/Zend/Validate/Hostname.php
index 1732e69c77..ba93d98627 100644
--- a/libs/Zend/Validate/Hostname.php
+++ b/libs/Zend/Validate/Hostname.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Hostname.php 21063 2010-02-15 23:00:17Z thomas $
+ * @version $Id: Hostname.php 23488 2010-12-10 07:22:55Z mjh_ca $
*/
/**
@@ -46,31 +46,33 @@
*/
class Zend_Validate_Hostname extends Zend_Validate_Abstract
{
+ const CANNOT_DECODE_PUNYCODE = 'hostnameCannotDecodePunycode';
const INVALID = 'hostnameInvalid';
- const IP_ADDRESS_NOT_ALLOWED = 'hostnameIpAddressNotAllowed';
- const UNKNOWN_TLD = 'hostnameUnknownTld';
const INVALID_DASH = 'hostnameDashCharacter';
- const INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema';
- const UNDECIPHERABLE_TLD = 'hostnameUndecipherableTld';
const INVALID_HOSTNAME = 'hostnameInvalidHostname';
+ const INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema';
const INVALID_LOCAL_NAME = 'hostnameInvalidLocalName';
+ const INVALID_URI = 'hostnameInvalidUri';
+ const IP_ADDRESS_NOT_ALLOWED = 'hostnameIpAddressNotAllowed';
const LOCAL_NAME_NOT_ALLOWED = 'hostnameLocalNameNotAllowed';
- const CANNOT_DECODE_PUNYCODE = 'hostnameCannotDecodePunycode';
+ const UNDECIPHERABLE_TLD = 'hostnameUndecipherableTld';
+ const UNKNOWN_TLD = 'hostnameUnknownTld';
/**
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be a string",
- self::IP_ADDRESS_NOT_ALLOWED => "'%value%' appears to be an IP address, but IP addresses are not allowed",
- self::UNKNOWN_TLD => "'%value%' appears to be a DNS hostname but cannot match TLD against known list",
+ self::CANNOT_DECODE_PUNYCODE => "'%value%' appears to be a DNS hostname but the given punycode notation cannot be decoded",
+ self::INVALID => "Invalid type given. String expected",
self::INVALID_DASH => "'%value%' appears to be a DNS hostname but contains a dash in an invalid position",
- self::INVALID_HOSTNAME_SCHEMA => "'%value%' appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'",
- self::UNDECIPHERABLE_TLD => "'%value%' appears to be a DNS hostname but cannot extract TLD part",
self::INVALID_HOSTNAME => "'%value%' does not match the expected structure for a DNS hostname",
+ self::INVALID_HOSTNAME_SCHEMA => "'%value%' appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'",
self::INVALID_LOCAL_NAME => "'%value%' does not appear to be a valid local network name",
+ self::INVALID_URI => "'%value%' does not appear to be a valid URI hostname",
+ self::IP_ADDRESS_NOT_ALLOWED => "'%value%' appears to be an IP address, but IP addresses are not allowed",
self::LOCAL_NAME_NOT_ALLOWED => "'%value%' appears to be a local network name but local network names are not allowed",
- self::CANNOT_DECODE_PUNYCODE => "'%value%' appears to be a DNS hostname but the given punycode notation cannot be decoded",
+ self::UNDECIPHERABLE_TLD => "'%value%' appears to be a DNS hostname but cannot extract TLD part",
+ self::UNKNOWN_TLD => "'%value%' appears to be a DNS hostname but cannot match TLD against known list",
);
/**
@@ -101,6 +103,11 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
const ALLOW_ALL = 7;
/**
+ * Allows all types of hostnames
+ */
+ const ALLOW_URI = 8;
+
+ /**
* Array of valid top-level-domains
*
* @see ftp://data.iana.org/TLD/tlds-alpha-by-domain.txt List of all TLDs by domain
@@ -196,7 +203,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
'CH' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'),
'CL' => array(1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'),
'CN' => 'Hostname/Cn.php',
- 'COM' => 'Zend/Validate/Hostname/Com.php',
+ 'COM' => 'Hostname/Com.php',
'DE' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),
'DK' => array(1 => '/^[\x{002d}0-9a-zäéöü]{1,63}$/iu'),
'ES' => array(1 => '/^[\x{002d}0-9a-zàáçèéíïñòóúü·]{1,63}$/iu'),
@@ -208,7 +215,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
6 => '/^[\x{002d}0-9a-zἀ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷῂῃῄῆῇῐ-ΐῖῗῠ-ῧῲῳῴῶῷ]{1,63}$/iu'),
'FI' => array(1 => '/^[\x{002d}0-9a-zäåö]{1,63}$/iu'),
'GR' => array(1 => '/^[\x{002d}0-9a-zΆΈΉΊΌΎ-ΡΣ-ώἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼῂῃῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲῳῴῶ-ῼ]{1,63}$/iu'),
- 'HK' => 'Zend/Validate/Hostname/Cn.php',
+ 'HK' => 'Hostname/Cn.php',
'HU' => array(1 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu'),
'INFO'=> array(1 => '/^[\x{002d}0-9a-zäåæéöøü]{1,63}$/iu',
2 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',
@@ -220,15 +227,15 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
8 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'),
'IO' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),
'IS' => array(1 => '/^[\x{002d}0-9a-záéýúíóþæöð]{1,63}$/iu'),
- 'JP' => 'Zend/Validate/Hostname/Jp.php',
+ 'JP' => 'Hostname/Jp.php',
'KR' => array(1 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu'),
'LI' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'),
'LT' => array(1 => '/^[\x{002d}0-9ąčęėįšųūž]{1,63}$/iu'),
'MD' => array(1 => '/^[\x{002d}0-9ăâîşţ]{1,63}$/iu'),
'MUSEUM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćċčďđēėęěğġģħīįıķĺļľłńņňŋōőœŕŗřśşšţťŧūůűųŵŷźżžǎǐǒǔ\x{01E5}\x{01E7}\x{01E9}\x{01EF}ə\x{0292}ẁẃẅỳ]{1,63}$/iu'),
- 'NET' => 'Zend/Validate/Hostname/Com.php',
+ 'NET' => 'Hostname/Com.php',
'NO' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),
- 'NU' => 'Zend/Validate/Hostname/Com.php',
+ 'NU' => 'Hostname/Com.php',
'ORG' => array(1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu',
2 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',
3 => '/^[\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu',
@@ -279,14 +286,14 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
'SJ' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),
'TH' => array(1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'),
'TM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'),
- 'TW' => 'Zend/Validate/Hostname/Cn.php',
+ 'TW' => 'Hostname/Cn.php',
'TR' => array(1 => '/^[\x{002d}0-9a-zğıüşöç]{1,63}$/iu'),
'VE' => array(1 => '/^[\x{002d}0-9a-záéíóúüñ]{1,63}$/iu'),
'VN' => array(1 => '/^[ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯư\x{1EA0}-\x{1EF9}]{1,63}$/iu'),
'ایران' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'),
- '中国' => 'Zend/Validate/Hostname/Cn.php',
- '公司' => 'Zend/Validate/Hostname/Cn.php',
- '网络' => 'Zend/Validate/Hostname/Cn.php'
+ '中国' => 'Hostname/Cn.php',
+ '公司' => 'Hostname/Cn.php',
+ '网络' => 'Hostname/Cn.php'
);
protected $_idnLength = array(
@@ -505,6 +512,21 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
}
}
+ // RFC3986 3.2.2 states:
+ //
+ // The rightmost domain label of a fully qualified domain name
+ // in DNS may be followed by a single "." and should be if it is
+ // necessary to distinguish between the complete domain name and
+ // some local domain.
+ //
+ // Strip trailing '.' since it is not necessary to validate a non-IP
+ // hostname.
+ //
+ // (see ZF-6363)
+ if (substr($value, -1) === '.') {
+ $value = substr($value, 0, strlen($value)-1);
+ }
+
// Check input against DNS hostname schema
$domainParts = explode('.', $value);
if ((count($domainParts) > 1) && (strlen($value) >= 4) && (strlen($value) <= 254)) {
@@ -544,7 +566,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
$regexChars = array(0 => '/^[a-z0-9\x2d]{1,63}$/i');
if ($this->_options['idn'] && isset($this->_validIdns[strtoupper($this->_tld)])) {
if (is_string($this->_validIdns[strtoupper($this->_tld)])) {
- $regexChars += include(dirname(__FILE__) . '/../../' . $this->_validIdns[strtoupper($this->_tld)]);
+ $regexChars += include(dirname(__FILE__) . DIR_SEPARATOR . $this->_validIdns[strtoupper($this->_tld)]);
} else {
$regexChars += $this->_validIdns[strtoupper($this->_tld)];
}
@@ -617,6 +639,15 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
$this->_error(self::INVALID_HOSTNAME);
}
+ // Check for URI Syntax (RFC3986)
+ if ($this->_options['allow'] & self::ALLOW_URI) {
+ if (preg_match("/^([a-zA-Z0-9-._~!$&\'()*+,;=]|%[[:xdigit:]]{2}){1,254}$/i", $value)) {
+ return true;
+ } else {
+ $this->_error(self::INVALID_URI);
+ }
+ }
+
// Check input against local network name schema; last chance to pass validation
$regexLocal = '/^(([a-zA-Z0-9\x2d]{1,63}\x2e)*[a-zA-Z0-9\x2d]{1,63}){1,254}$/';
$status = @preg_match($regexLocal, $value);
diff --git a/libs/Zend/Validate/Iban.php b/libs/Zend/Validate/Iban.php
index 4b781a09c6..427857a1c7 100644
--- a/libs/Zend/Validate/Iban.php
+++ b/libs/Zend/Validate/Iban.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Iban.php 22401 2010-06-09 19:25:49Z thomas $
+ * @version $Id: Iban.php 22400 2010-06-09 19:25:02Z thomas $
*/
/**
diff --git a/libs/Zend/Validate/Identical.php b/libs/Zend/Validate/Identical.php
index 7b37574050..3ebaf028af 100644
--- a/libs/Zend/Validate/Identical.php
+++ b/libs/Zend/Validate/Identical.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Identical.php 22077 2010-05-02 13:44:46Z thomas $
+ * @version $Id: Identical.php 22075 2010-05-02 13:42:08Z thomas $
*/
/** @see Zend_Validate_Abstract */
diff --git a/libs/Zend/Validate/InArray.php b/libs/Zend/Validate/InArray.php
index 3b1870543c..567d3df4d0 100644
--- a/libs/Zend/Validate/InArray.php
+++ b/libs/Zend/Validate/InArray.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: InArray.php 20358 2010-01-17 19:03:49Z thomas $
+ * @version $Id: InArray.php 20352 2010-01-17 17:55:38Z thomas $
*/
/**
diff --git a/libs/Zend/Validate/Int.php b/libs/Zend/Validate/Int.php
index 012a58a0ee..2f82b98bfd 100644
--- a/libs/Zend/Validate/Int.php
+++ b/libs/Zend/Validate/Int.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Int.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Int.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -44,7 +44,7 @@ class Zend_Validate_Int extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be string or integer",
+ self::INVALID => "Invalid type given. String or integer expected",
self::NOT_INT => "'%value%' does not appear to be an integer",
);
diff --git a/libs/Zend/Validate/Interface.php b/libs/Zend/Validate/Interface.php
index 9dfca94219..f683b60f02 100644
--- a/libs/Zend/Validate/Interface.php
+++ b/libs/Zend/Validate/Interface.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Interface.php 20358 2010-01-17 19:03:49Z thomas $
+ * @version $Id: Interface.php 23262 2010-10-27 14:03:36Z matthew $
*/
/**
@@ -36,7 +36,7 @@ interface Zend_Validate_Interface
*
* @param mixed $value
* @return boolean
- * @throws Zend_Valid_Exception If validation of $value is impossible
+ * @throws Zend_Validate_Exception If validation of $value is impossible
*/
public function isValid($value);
diff --git a/libs/Zend/Validate/Ip.php b/libs/Zend/Validate/Ip.php
index 8cb9a1e379..091ff9b615 100644
--- a/libs/Zend/Validate/Ip.php
+++ b/libs/Zend/Validate/Ip.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Ip.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Ip.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -39,7 +39,7 @@ class Zend_Validate_Ip extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be a string",
+ self::INVALID => "Invalid type given. String expected",
self::NOT_IP_ADDRESS => "'%value%' does not appear to be a valid IP address",
);
diff --git a/libs/Zend/Validate/Isbn.php b/libs/Zend/Validate/Isbn.php
index 61ebf0b9a8..5c78872faf 100644
--- a/libs/Zend/Validate/Isbn.php
+++ b/libs/Zend/Validate/Isbn.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Isbn.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Isbn.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -44,7 +44,7 @@ class Zend_Validate_Isbn extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be string or integer",
+ self::INVALID => "Invalid type given. String or integer expected",
self::NO_ISBN => "'%value%' is no valid ISBN number",
);
diff --git a/libs/Zend/Validate/NotEmpty.php b/libs/Zend/Validate/NotEmpty.php
index 150efddbde..584e290887 100644
--- a/libs/Zend/Validate/NotEmpty.php
+++ b/libs/Zend/Validate/NotEmpty.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: NotEmpty.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: NotEmpty.php 22691 2010-07-26 19:29:14Z thomas $
*/
/**
@@ -70,7 +70,7 @@ class Zend_Validate_NotEmpty extends Zend_Validate_Abstract
*/
protected $_messageTemplates = array(
self::IS_EMPTY => "Value is required and can't be empty",
- self::INVALID => "Invalid type given, value should be float, string, array, boolean or integer",
+ self::INVALID => "Invalid type given. String, integer, float, boolean or array expected",
);
/**
diff --git a/libs/Zend/Validate/PostCode.php b/libs/Zend/Validate/PostCode.php
index 9f7ea69e63..4aa1cd1d31 100644
--- a/libs/Zend/Validate/PostCode.php
+++ b/libs/Zend/Validate/PostCode.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: PostCode.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: PostCode.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -44,7 +44,7 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given. The value should be a string or a integer",
+ self::INVALID => "Invalid type given. String or integer expected",
self::NO_MATCH => "'%value%' does not appear to be a postal code",
);
diff --git a/libs/Zend/Validate/Regex.php b/libs/Zend/Validate/Regex.php
index ff7cbb5252..4784d2ae92 100644
--- a/libs/Zend/Validate/Regex.php
+++ b/libs/Zend/Validate/Regex.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Regex.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Regex.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -40,7 +40,7 @@ class Zend_Validate_Regex extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be string, integer or float",
+ self::INVALID => "Invalid type given. String, integer or float expected",
self::NOT_MATCH => "'%value%' does not match against pattern '%pattern%'",
self::ERROROUS => "There was an internal error while using the pattern '%pattern%'",
);
diff --git a/libs/Zend/Validate/Sitemap/Changefreq.php b/libs/Zend/Validate/Sitemap/Changefreq.php
index 3f190efa0f..39532e7775 100644
--- a/libs/Zend/Validate/Sitemap/Changefreq.php
+++ b/libs/Zend/Validate/Sitemap/Changefreq.php
@@ -17,7 +17,7 @@
* @subpackage Sitemap
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Changefreq.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Changefreq.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -52,7 +52,7 @@ class Zend_Validate_Sitemap_Changefreq extends Zend_Validate_Abstract
*/
protected $_messageTemplates = array(
self::NOT_VALID => "'%value%' is no valid sitemap changefreq",
- self::INVALID => "Invalid type given, the value should be a string",
+ self::INVALID => "Invalid type given. String expected",
);
/**
diff --git a/libs/Zend/Validate/Sitemap/Lastmod.php b/libs/Zend/Validate/Sitemap/Lastmod.php
index 362e562eac..2495d0ba68 100644
--- a/libs/Zend/Validate/Sitemap/Lastmod.php
+++ b/libs/Zend/Validate/Sitemap/Lastmod.php
@@ -17,7 +17,7 @@
* @subpackage Sitemap
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Lastmod.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Lastmod.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -58,7 +58,7 @@ class Zend_Validate_Sitemap_Lastmod extends Zend_Validate_Abstract
*/
protected $_messageTemplates = array(
self::NOT_VALID => "'%value%' is no valid sitemap lastmod",
- self::INVALID => "Invalid type given, the value should be a string",
+ self::INVALID => "Invalid type given. String expected",
);
/**
diff --git a/libs/Zend/Validate/Sitemap/Loc.php b/libs/Zend/Validate/Sitemap/Loc.php
index d4df42e307..15eea11862 100644
--- a/libs/Zend/Validate/Sitemap/Loc.php
+++ b/libs/Zend/Validate/Sitemap/Loc.php
@@ -17,7 +17,7 @@
* @subpackage Sitemap
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Loc.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Loc.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -57,7 +57,7 @@ class Zend_Validate_Sitemap_Loc extends Zend_Validate_Abstract
*/
protected $_messageTemplates = array(
self::NOT_VALID => "'%value%' is no valid sitemap location",
- self::INVALID => "Invalid type given, the value should be a string",
+ self::INVALID => "Invalid type given. String expected",
);
/**
diff --git a/libs/Zend/Validate/Sitemap/Priority.php b/libs/Zend/Validate/Sitemap/Priority.php
index 8d340de900..04fd997d61 100644
--- a/libs/Zend/Validate/Sitemap/Priority.php
+++ b/libs/Zend/Validate/Sitemap/Priority.php
@@ -17,7 +17,7 @@
* @subpackage Sitemap
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Priority.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: Priority.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -52,7 +52,7 @@ class Zend_Validate_Sitemap_Priority extends Zend_Validate_Abstract
*/
protected $_messageTemplates = array(
self::NOT_VALID => "'%value%' is no valid sitemap priority",
- self::INVALID => "Invalid type given, the value should be a integer, a float or a numeric string",
+ self::INVALID => "Invalid type given. Numeric string, integer or float expected",
);
/**
diff --git a/libs/Zend/Validate/StringLength.php b/libs/Zend/Validate/StringLength.php
index 807269178f..3b94792788 100644
--- a/libs/Zend/Validate/StringLength.php
+++ b/libs/Zend/Validate/StringLength.php
@@ -16,7 +16,7 @@
* @package Zend_Validate
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: StringLength.php 22697 2010-07-26 21:14:47Z alexander $
+ * @version $Id: StringLength.php 22668 2010-07-25 14:50:46Z thomas $
*/
/**
@@ -40,7 +40,7 @@ class Zend_Validate_StringLength extends Zend_Validate_Abstract
* @var array
*/
protected $_messageTemplates = array(
- self::INVALID => "Invalid type given, value should be a string",
+ self::INVALID => "Invalid type given. String expected",
self::TOO_SHORT => "'%value%' is less than %min% characters long",
self::TOO_LONG => "'%value%' is more than %max% characters long",
);