Index: library/Zend/Filter/Input.php =================================================================== --- library/Zend/Filter/Input.php (revision 745) +++ library/Zend/Filter/Input.php (working copy) @@ -55,6 +55,7 @@ */ public function getAlpha($key) { + if(!array_key_exists($key, $this->_source)) { return false; } return Zend_Filter::getAlpha($this->_source[$key]); } @@ -67,6 +68,7 @@ */ public function getAlnum($key) { + if(!array_key_exists($key, $this->_source)) { return false; } return Zend_Filter::getAlnum($this->_source[$key]); } @@ -79,6 +81,7 @@ */ public function getDigits($key) { + if(!array_key_exists($key, $this->_source)) { return false; } return Zend_Filter::getDigits($this->_source[$key]); } @@ -91,6 +94,7 @@ */ public function getDir($key) { + if(!array_key_exists($key, $this->_source)) { return false; } return Zend_Filter::getDir($this->_source[$key]); } @@ -103,6 +107,7 @@ */ public function getInt($key) { + if(!array_key_exists($key, $this->_source)) { return false; } return Zend_Filter::getInt($this->_source[$key]); } @@ -115,6 +120,7 @@ */ public function getPath($key) { + if(!array_key_exists($key, $this->_source)) { return false; } return Zend_Filter::getPath($this->_source[$key]); } @@ -127,6 +133,7 @@ */ public function getRaw($key) { + if(!array_key_exists($key, $this->_source)) { return false; } return $this->_source[$key]; } @@ -140,6 +147,7 @@ */ public function testAlnum($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isAlnum($this->_source[$key])) { return $this->_source[$key]; } @@ -157,6 +165,7 @@ */ public function testAlpha($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isAlpha($this->_source[$key])) { return $this->_source[$key]; } @@ -179,6 +188,7 @@ */ public function testBetween($key, $min, $max, $inc = TRUE) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isBetween($this->_source[$key], $min, $max, $inc)) { return $this->_source[$key]; } @@ -198,6 +208,7 @@ */ public function testCcnum($key, $type = NULL) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isCcnum($this->_source[$key], $type)) { return $this->_source[$key]; } @@ -215,6 +226,7 @@ */ public function testDate($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isDate($this->_source[$key])) { return $this->_source[$key]; } @@ -232,6 +244,7 @@ */ public function testDigits($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isDigits($this->_source[$key])) { return $this->_source[$key]; } @@ -248,6 +261,7 @@ */ public function testEmail($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isEmail($this->_source[$key])) { return $this->_source[$key]; } @@ -264,6 +278,7 @@ */ public function testFloat($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isFloat($this->_source[$key])) { return $this->_source[$key]; } @@ -281,6 +296,7 @@ */ public function testGreaterThan($key, $min = NULL) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isGreaterThan($this->_source[$key], $min)) { return $this->_source[$key]; } @@ -298,6 +314,7 @@ */ public function testHex($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isHex($this->_source[$key])) { return $this->_source[$key]; } @@ -319,6 +336,7 @@ */ public function testHostname($key, $allow = Zend_Filter::HOST_ALLOW_ALL) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isHostname($this->_source[$key], $allow)) { return $this->_source[$key]; } @@ -335,6 +353,7 @@ */ public function testInt($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isInt($this->_source[$key])) { return $this->_source[$key]; } @@ -351,6 +370,7 @@ */ public function testIp($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isIp($this->_source[$key])) { return $this->_source[$key]; } @@ -368,6 +388,7 @@ */ public function testLessThan($key, $max = NULL) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isLessThan($this->_source[$key], $max)) { return $this->_source[$key]; } @@ -385,6 +406,7 @@ */ public function testName($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isName($this->_source[$key])) { return $this->_source[$key]; } @@ -401,6 +423,7 @@ */ public function testOneOf($key, $allowed = NULL) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isOneOf($this->_source[$key], $allowed)) { return $this->_source[$key]; } @@ -418,6 +441,7 @@ */ public function testPhone($key, $country = 'US') { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isPhone($this->_source[$key], $country)) { return $this->_source[$key]; } @@ -436,6 +460,7 @@ */ public function testRegex($key, $pattern = NULL) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isRegex($this->_source[$key], $pattern)) { return $this->_source[$key]; } @@ -446,6 +471,7 @@ public function testUri($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isUri($this->_source[$key])) { return $this->_source[$key]; } @@ -462,6 +488,7 @@ */ public function testZip($key) { + if(!array_key_exists($key, $this->_source)) { return false; } if (Zend_Filter::isZip($this->_source[$key])) { return $this->_source[$key]; } @@ -478,6 +505,7 @@ */ public function noTags($key) { + if(!array_key_exists($key, $this->_source)) { return false; } return Zend_Filter::noTags($this->_source[$key]); } @@ -490,6 +518,16 @@ */ public function noPath($key) { + if(!array_key_exists($key, $this->_source)) { return false; } return Zend_Filter::noPath($this->_source[$key]); } + + /** Checks if a key exists + * + * @param mixed $key + * @return bool + */ + public function keyExists($key) { + return (array_key_exists($key, $this->_source)); + } }