Mise à jour Zend Framework en version 1.11.9
This commit is contained in:
parent
c1e420d948
commit
3f18a3831f
@ -17,7 +17,7 @@
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Modules.php 24106 2011-06-03 23:25:41Z freak $
|
||||
* @version $Id: Modules.php 24227 2011-07-12 19:41:46Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -117,12 +117,11 @@ class Zend_Application_Resource_Modules extends Zend_Application_Resource_Resour
|
||||
protected function bootstrapBootstraps($bootstraps)
|
||||
{
|
||||
$bootstrap = $this->getBootstrap();
|
||||
$out = array();
|
||||
$out = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
|
||||
|
||||
foreach($bootstraps as $module => $bootstrapClass) {
|
||||
$moduleBootstrap = new $bootstrapClass($bootstrap);
|
||||
$moduleBootstrap->bootstrap();
|
||||
$this->_bootstraps[$module] = $moduleBootstrap;
|
||||
$out[$module] = $moduleBootstrap;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Zend_Cache_Frontend
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: File.php 23793 2011-03-02 22:31:05Z mabe $
|
||||
* @version $Id: File.php 24218 2011-07-10 01:22:58Z ramon $
|
||||
*/
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@ class Zend_Cache_Frontend_File extends Zend_Cache_Core
|
||||
$this->_masterFile_mtimes[$i] = $mtime;
|
||||
$this->_specificOptions['master_files'][$i] = $masterFile;
|
||||
if ($i === 0) { // to keep a compatibility
|
||||
$this->_specificOptions['master_files'] = $masterFile;
|
||||
$this->_specificOptions['master_file'] = $masterFile;
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
@ -37,7 +37,7 @@ require_once 'Zend/Service/ReCaptcha.php';
|
||||
* @subpackage Adapter
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ReCaptcha.php 23775 2011-03-01 17:25:24Z ralph $
|
||||
* @version $Id: ReCaptcha.php 24242 2011-07-14 13:44:06Z matthew $
|
||||
*/
|
||||
class Zend_Captcha_ReCaptcha extends Zend_Captcha_Base
|
||||
{
|
||||
@ -261,6 +261,20 @@ class Zend_Captcha_ReCaptcha extends Zend_Captcha_Base
|
||||
*/
|
||||
public function render(Zend_View_Interface $view = null, $element = null)
|
||||
{
|
||||
return $this->getService()->getHTML();
|
||||
$name = null;
|
||||
if ($element instanceof Zend_Form_Element) {
|
||||
$name = $element->getBelongsTo();
|
||||
}
|
||||
return $this->getService()->getHTML($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get captcha decorator
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDecorator()
|
||||
{
|
||||
return "Captcha_ReCaptcha";
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Zend_Controller_Action_Helper
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ViewRenderer.php 24200 2011-07-05 16:12:07Z matthew $
|
||||
* @version $Id: ViewRenderer.php 24225 2011-07-12 19:23:12Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -627,6 +627,9 @@ class Zend_Controller_Action_Helper_ViewRenderer extends Zend_Controller_Action_
|
||||
$vars['action'] = $action;
|
||||
}
|
||||
|
||||
$replacePattern = array('/[^a-z0-9]+$/i', '/^[^a-z0-9]+/i');
|
||||
$vars['action'] = preg_replace($replacePattern, '', $vars['action']);
|
||||
|
||||
// Remove non-alphanumeric characters from action name
|
||||
// see ZF-10725
|
||||
$vars['action'] = preg_replace(
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Plugins
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Broker.php 23775 2011-03-01 17:25:24Z ralph $
|
||||
* @version $Id: Broker.php 24241 2011-07-14 08:09:41Z bate $
|
||||
*/
|
||||
|
||||
/** Zend_Controller_Plugin_Abstract */
|
||||
@ -237,7 +237,7 @@ class Zend_Controller_Plugin_Broker extends Zend_Controller_Plugin_Abstract
|
||||
$plugin->routeStartup($request);
|
||||
} catch (Exception $e) {
|
||||
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
|
||||
throw $e;
|
||||
throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
|
||||
} else {
|
||||
$this->getResponse()->setException($e);
|
||||
}
|
||||
@ -260,7 +260,7 @@ class Zend_Controller_Plugin_Broker extends Zend_Controller_Plugin_Abstract
|
||||
$plugin->routeShutdown($request);
|
||||
} catch (Exception $e) {
|
||||
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
|
||||
throw $e;
|
||||
throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
|
||||
} else {
|
||||
$this->getResponse()->setException($e);
|
||||
}
|
||||
@ -287,7 +287,7 @@ class Zend_Controller_Plugin_Broker extends Zend_Controller_Plugin_Abstract
|
||||
$plugin->dispatchLoopStartup($request);
|
||||
} catch (Exception $e) {
|
||||
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
|
||||
throw $e;
|
||||
throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
|
||||
} else {
|
||||
$this->getResponse()->setException($e);
|
||||
}
|
||||
@ -309,9 +309,11 @@ class Zend_Controller_Plugin_Broker extends Zend_Controller_Plugin_Abstract
|
||||
$plugin->preDispatch($request);
|
||||
} catch (Exception $e) {
|
||||
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
|
||||
throw $e;
|
||||
throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
|
||||
} else {
|
||||
$this->getResponse()->setException($e);
|
||||
// skip rendering of normal dispatch give the error handler a try
|
||||
$this->getRequest()->setDispatched(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -331,7 +333,7 @@ class Zend_Controller_Plugin_Broker extends Zend_Controller_Plugin_Abstract
|
||||
$plugin->postDispatch($request);
|
||||
} catch (Exception $e) {
|
||||
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
|
||||
throw $e;
|
||||
throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
|
||||
} else {
|
||||
$this->getResponse()->setException($e);
|
||||
}
|
||||
@ -353,7 +355,7 @@ class Zend_Controller_Plugin_Broker extends Zend_Controller_Plugin_Abstract
|
||||
$plugin->dispatchLoopShutdown();
|
||||
} catch (Exception $e) {
|
||||
if (Zend_Controller_Front::getInstance()->throwExceptions()) {
|
||||
throw $e;
|
||||
throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
|
||||
} else {
|
||||
$this->getResponse()->setException($e);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ require_once 'Zend/Controller/Plugin/Abstract.php';
|
||||
* @subpackage Plugins
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ErrorHandler.php 23775 2011-03-01 17:25:24Z ralph $
|
||||
* @version $Id: ErrorHandler.php 24241 2011-07-14 08:09:41Z bate $
|
||||
*/
|
||||
class Zend_Controller_Plugin_ErrorHandler extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
@ -201,6 +201,17 @@ class Zend_Controller_Plugin_ErrorHandler extends Zend_Controller_Plugin_Abstrac
|
||||
$this->_handleError($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre dispatch hook -- check for exceptions and dispatch error handler if
|
||||
* necessary
|
||||
*
|
||||
* @param Zend_Controller_Request_Abstract $request
|
||||
*/
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
$this->_handleError($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Post dispatch hook -- check for exceptions and dispatch error handler if
|
||||
* necessary
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_Filter
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Input.php 23775 2011-03-01 17:25:24Z ralph $
|
||||
* @version $Id: Input.php 24229 2011-07-13 11:05:10Z mcleod@spaceweb.nl $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -802,6 +802,9 @@ class Zend_Filter_Input
|
||||
return;
|
||||
}
|
||||
|
||||
// remember the default not empty message in case we want to temporarily change it
|
||||
$preserveDefaultNotEmptyMessage = $this->_defaults[self::NOT_EMPTY_MESSAGE];
|
||||
|
||||
foreach ($this->_validatorRules as $ruleName => &$validatorRule) {
|
||||
/**
|
||||
* Make sure we have an array representing this validator chain.
|
||||
@ -836,7 +839,33 @@ class Zend_Filter_Input
|
||||
$validatorRule[self::PRESENCE] = $this->_defaults[self::PRESENCE];
|
||||
}
|
||||
if (!isset($validatorRule[self::ALLOW_EMPTY])) {
|
||||
$foundNotEmptyValidator = false;
|
||||
|
||||
foreach ($validatorRule as $rule) {
|
||||
if ($rule === 'NotEmpty') {
|
||||
$foundNotEmptyValidator = true;
|
||||
// field may not be empty, we are ready
|
||||
break 1;
|
||||
}
|
||||
|
||||
// we must check if it is an object before using instanceof
|
||||
if (!is_object($rule)) {
|
||||
// it cannot be a NotEmpty validator, skip this one
|
||||
continue;
|
||||
}
|
||||
|
||||
if($rule instanceof Zend_Validate_NotEmpty) {
|
||||
$foundNotEmptyValidator = true;
|
||||
// field may not be empty, we are ready
|
||||
break 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$foundNotEmptyValidator) {
|
||||
$validatorRule[self::ALLOW_EMPTY] = $this->_defaults[self::ALLOW_EMPTY];
|
||||
} else {
|
||||
$validatorRule[self::ALLOW_EMPTY] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($validatorRule[self::MESSAGES])) {
|
||||
@ -844,6 +873,8 @@ class Zend_Filter_Input
|
||||
} else if (!is_array($validatorRule[self::MESSAGES])) {
|
||||
$validatorRule[self::MESSAGES] = array($validatorRule[self::MESSAGES]);
|
||||
} else if (array_intersect_key($validatorList, $validatorRule[self::MESSAGES])) {
|
||||
// this seems pointless... it just re-adds what it already has...
|
||||
// I can disable all this and not a single unit test fails...
|
||||
// There are now corresponding numeric keys in the validation rule messages array
|
||||
// Treat it as a named messages list for all rule validators
|
||||
$unifiedMessages = $validatorRule[self::MESSAGES];
|
||||
@ -876,9 +907,19 @@ class Zend_Filter_Input
|
||||
}
|
||||
|
||||
if ($validator instanceof Zend_Validate_NotEmpty) {
|
||||
/** we are changing the defaults here, this is alright if all subsequent validators are also a not empty
|
||||
* validator, but it goes wrong if one of them is not AND is required!!!
|
||||
* that is why we restore the default value at the end of this loop
|
||||
*/
|
||||
if (is_array($value)) {
|
||||
$temp = $value; // keep the original value
|
||||
$this->_defaults[self::NOT_EMPTY_MESSAGE] = array_pop($temp);
|
||||
unset($temp);
|
||||
} else {
|
||||
$this->_defaults[self::NOT_EMPTY_MESSAGE] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$validatorRule[self::VALIDATOR_CHAIN]->addValidator($validator, $validatorRule[self::BREAK_CHAIN]);
|
||||
}
|
||||
@ -897,8 +938,13 @@ class Zend_Filter_Input
|
||||
} else {
|
||||
$this->_validateRule($validatorRule);
|
||||
}
|
||||
|
||||
// reset the default not empty message
|
||||
$this->_defaults[self::NOT_EMPTY_MESSAGE] = $preserveDefaultNotEmptyMessage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Unset fields in $_data that have been added to other arrays.
|
||||
* We have to wait until all rules have been processed because
|
||||
@ -972,8 +1018,11 @@ class Zend_Filter_Input
|
||||
$messages = array();
|
||||
|
||||
foreach ($data as $fieldKey => $field) {
|
||||
// if there is no Zend_Validate_NotEmpty instance in the rules, we will use the default
|
||||
if (!($notEmptyValidator = $this->_getNotEmptyValidatorInstance($validatorRule))) {
|
||||
$notEmptyValidator = $this->_getValidator('NotEmpty');
|
||||
$notEmptyValidator->setMessage($this->_getNotEmptyMessage($validatorRule[self::RULE], $fieldKey));
|
||||
}
|
||||
|
||||
if (!$notEmptyValidator->isValid($field)) {
|
||||
foreach ($notEmptyValidator->getMessages() as $messageKey => $message) {
|
||||
@ -1011,8 +1060,12 @@ class Zend_Filter_Input
|
||||
$field = array($field);
|
||||
}
|
||||
|
||||
// if there is no Zend_Validate_NotEmpty instance in the rules, we will use the default
|
||||
if (!($notEmptyValidator = $this->_getNotEmptyValidatorInstance($validatorRule))) {
|
||||
$notEmptyValidator = $this->_getValidator('NotEmpty');
|
||||
$notEmptyValidator->setMessage($this->_getNotEmptyMessage($validatorRule[self::RULE], $fieldName));
|
||||
}
|
||||
|
||||
if ($validatorRule[self::ALLOW_EMPTY]) {
|
||||
$validatorChain = $validatorRule[self::VALIDATOR_CHAIN];
|
||||
} else {
|
||||
@ -1071,6 +1124,23 @@ class Zend_Filter_Input
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a validatorRule for the presence of a NotEmpty validator instance.
|
||||
* The purpose is to preserve things like a custom message, that may have been
|
||||
* set on the validator outside Zend_Filter_Input.
|
||||
* @param array $validatorRule
|
||||
* @return mixed false if none is found, Zend_Validate_NotEmpty instance if found
|
||||
*/
|
||||
protected function _getNotEmptyValidatorInstance($validatorRule) {
|
||||
foreach ($validatorRule as $rule => $value) {
|
||||
if (is_object($value) and $value instanceof Zend_Validate_NotEmpty) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $classBaseName
|
||||
* @return Zend_Filter_Interface
|
||||
|
115
library/Zend/Form/Decorator/Captcha/ReCaptcha.php
Normal file
115
library/Zend/Form/Decorator/Captcha/ReCaptcha.php
Normal file
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Form
|
||||
* @subpackage Decorator
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
/** @see Zend_Form_Decorator_Abstract */
|
||||
require_once 'Zend/Form/Decorator/Abstract.php';
|
||||
|
||||
/**
|
||||
* ReCaptcha-based captcha decorator
|
||||
*
|
||||
* Adds hidden fields for challenge and response input, and JS for populating
|
||||
* from known recaptcha IDs
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Form
|
||||
* @subpackage Element
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Form_Decorator_Captcha_ReCaptcha extends Zend_Form_Decorator_Abstract
|
||||
{
|
||||
/**
|
||||
* Render captcha
|
||||
*
|
||||
* @param string $content
|
||||
* @return string
|
||||
*/
|
||||
public function render($content)
|
||||
{
|
||||
$element = $this->getElement();
|
||||
if (!$element instanceof Zend_Form_Element_Captcha) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
$view = $element->getView();
|
||||
if (null === $view) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
$id = $element->getId();
|
||||
$name = $element->getBelongsTo();
|
||||
$placement = $this->getPlacement();
|
||||
$separator = $this->getSeparator();
|
||||
$challengeName = empty($name) ? 'recaptcha_challenge_field' : $name . '[recaptcha_challenge_field]';
|
||||
$responseName = empty($name) ? 'recaptcha_response_field' : $name . '[recaptcha_response_field]';
|
||||
$challengeId = $id . '-challenge';
|
||||
$responseId = $id . '-response';
|
||||
$captcha = $element->getCaptcha();
|
||||
$markup = $captcha->render($view, $element);
|
||||
|
||||
// Create hidden fields for holding the final recaptcha values
|
||||
// Placing "id" in "attribs" to ensure it is not overwritten with the name
|
||||
$hidden = $view->formHidden(array(
|
||||
'name' => $challengeName,
|
||||
'attribs' => array('id' => $challengeId),
|
||||
));
|
||||
$hidden .= $view->formHidden(array(
|
||||
'name' => $responseName,
|
||||
'attribs' => array('id' => $responseId),
|
||||
));
|
||||
|
||||
// Create a window.onload event so that we can bind to the form.
|
||||
// Once bound, add an onsubmit event that will replace the hidden field
|
||||
// values with those produced by ReCaptcha
|
||||
$js =<<<EOJ
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
function windowOnLoad(fn) {
|
||||
var old = window.onload;
|
||||
window.onload = function() {
|
||||
if (old) {
|
||||
old();
|
||||
}
|
||||
fn();
|
||||
};
|
||||
}
|
||||
windowOnLoad(function(){
|
||||
document.getElementById("$challengeId").form.addEventListener("submit", function(e) {
|
||||
document.getElementById("$challengeId").value = document.getElementById("recaptcha_challenge_field").value;
|
||||
document.getElementById("$responseId").value = document.getElementById("recaptcha_response_field").value;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
EOJ;
|
||||
|
||||
// Always place the hidden fields before the captcha markup, and follow
|
||||
// with the JS from above
|
||||
switch ($placement) {
|
||||
case 'PREPEND':
|
||||
$content = $hidden . $markup . $js . $separator . $content;
|
||||
break;
|
||||
case 'APPEND':
|
||||
default:
|
||||
$content = $content . $separator . $hidden . $markup . $js;
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Element
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Captcha.php 23871 2011-04-23 22:40:16Z ramon $
|
||||
* @version $Id: Captcha.php 24224 2011-07-12 17:45:49Z matthew $
|
||||
*/
|
||||
|
||||
/** @see Zend_Form_Element_Xhtml */
|
||||
@ -183,10 +183,10 @@ class Zend_Form_Element_Captcha extends Zend_Form_Element_Xhtml
|
||||
$decorator = $captcha->getDecorator();
|
||||
if (!empty($decorator)) {
|
||||
array_unshift($decorators, $decorator);
|
||||
}
|
||||
|
||||
} else {
|
||||
$decorator = array('Captcha', array('captcha' => $captcha));
|
||||
array_unshift($decorators, $decorator);
|
||||
}
|
||||
|
||||
$this->setDecorators($decorators);
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Formatter
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Xml.php 24128 2011-06-07 23:11:58Z adamlundrigan $
|
||||
* @version $Id: Xml.php 24237 2011-07-13 18:22:20Z matthew $
|
||||
*/
|
||||
|
||||
/** Zend_Log_Formatter_Abstract */
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Log/Formatter/Abstract.php';
|
||||
* @subpackage Formatter
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Xml.php 24128 2011-06-07 23:11:58Z adamlundrigan $
|
||||
* @version $Id: Xml.php 24237 2011-07-13 18:22:20Z matthew $
|
||||
*/
|
||||
class Zend_Log_Formatter_Xml extends Zend_Log_Formatter_Abstract
|
||||
{
|
||||
@ -146,7 +146,10 @@ class Zend_Log_Formatter_Xml extends Zend_Log_Formatter_Abstract
|
||||
$elt = $dom->appendChild(new DOMElement($this->_rootElement));
|
||||
|
||||
foreach ($dataToInsert as $key => $value) {
|
||||
if(empty($value) || is_scalar($value)) {
|
||||
if (empty($value)
|
||||
|| is_scalar($value)
|
||||
|| (is_object($value) && method_exists($value,'__toString'))
|
||||
) {
|
||||
if($key == "message") {
|
||||
$value = htmlspecialchars($value, ENT_COMPAT, $enc);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Page
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Mvc.php 24119 2011-06-04 14:35:38Z freak $
|
||||
* @version $Id: Mvc.php 24235 2011-07-13 18:13:45Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -163,6 +163,12 @@ class Zend_Navigation_Page_Mvc extends Zend_Navigation_Page
|
||||
$myParams['action'] = $front->getDefaultAction();
|
||||
}
|
||||
|
||||
foreach($myParams as $key => $value) {
|
||||
if($value == null) {
|
||||
unset($myParams[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if (count(array_intersect_assoc($reqParams, $myParams)) ==
|
||||
count($myParams)) {
|
||||
$this->_active = true;
|
||||
|
@ -36,7 +36,7 @@ require_once 'Zend/Service/ReCaptcha/Response.php';
|
||||
* @subpackage ReCaptcha
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ReCaptcha.php 23958 2011-05-03 10:38:59Z yoshida@zend.co.jp $
|
||||
* @version $Id: ReCaptcha.php 24224 2011-07-12 17:45:49Z matthew $
|
||||
*/
|
||||
class Zend_Service_ReCaptcha extends Zend_Service_Abstract
|
||||
{
|
||||
@ -373,10 +373,11 @@ class Zend_Service_ReCaptcha extends Zend_Service_Abstract
|
||||
*
|
||||
* This method uses the public key to fetch a recaptcha form.
|
||||
*
|
||||
* @param null|string $name Base name for recaptcha form elements
|
||||
* @return string
|
||||
* @throws Zend_Service_ReCaptcha_Exception
|
||||
*/
|
||||
public function getHtml()
|
||||
public function getHtml($name = null)
|
||||
{
|
||||
if ($this->_publicKey === null) {
|
||||
/** @see Zend_Service_ReCaptcha_Exception */
|
||||
@ -415,6 +416,12 @@ class Zend_Service_ReCaptcha extends Zend_Service_Abstract
|
||||
</script>
|
||||
SCRIPT;
|
||||
}
|
||||
$challengeField = 'recaptcha_challenge_field';
|
||||
$responseField = 'recaptcha_response_field';
|
||||
if (!empty($name)) {
|
||||
$challengeField = $name . '[' . $challengeField . ']';
|
||||
$responseField = $name . '[' . $responseField . ']';
|
||||
}
|
||||
|
||||
$return = $reCaptchaOptions;
|
||||
$return .= <<<HTML
|
||||
@ -426,9 +433,9 @@ HTML;
|
||||
<noscript>
|
||||
<iframe src="{$host}/noscript?k={$this->_publicKey}{$errorPart}"
|
||||
height="300" width="500" frameborder="0"></iframe>{$htmlBreak}
|
||||
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
|
||||
<textarea name="{$challengeField}" rows="3" cols="40">
|
||||
</textarea>
|
||||
<input type="hidden" name="recaptcha_response_field"
|
||||
<input type="hidden" name="{$responseField}"
|
||||
value="manual_challenge"{$htmlInputClosing}
|
||||
</noscript>
|
||||
HTML;
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_Test
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ControllerTestCase.php 23775 2011-03-01 17:25:24Z ralph $
|
||||
* @version $Id: ControllerTestCase.php 24213 2011-07-08 21:16:45Z rdohms $
|
||||
*/
|
||||
|
||||
/** @see PHPUnit_Runner_Version */
|
||||
@ -1120,7 +1120,7 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te
|
||||
/**
|
||||
* Retrieve test case request object
|
||||
*
|
||||
* @return Zend_Controller_Request_Abstract
|
||||
* @return Zend_Controller_Request_HttpTestCase
|
||||
*/
|
||||
public function getRequest()
|
||||
{
|
||||
@ -1134,7 +1134,7 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te
|
||||
/**
|
||||
* Retrieve test case response object
|
||||
*
|
||||
* @return Zend_Controller_Response_Abstract
|
||||
* @return Zend_Controller_Response_HttpTestCase
|
||||
*/
|
||||
public function getResponse()
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Zend_Translate_Adapter
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Adapter.php 24126 2011-06-07 23:00:59Z adamlundrigan $
|
||||
* @version $Id: Adapter.php 24215 2011-07-08 21:27:44Z guilhermeblanco $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -245,9 +245,14 @@ abstract class Zend_Translate_Adapter {
|
||||
if (is_string($options['content']) and is_dir($options['content'])) {
|
||||
$options['content'] = realpath($options['content']);
|
||||
$prev = '';
|
||||
foreach (new RecursiveIteratorIterator(
|
||||
$iterator = new RecursiveIteratorIterator(
|
||||
new RecursiveRegexIterator(
|
||||
new RecursiveDirectoryIterator($options['content'], RecursiveDirectoryIterator::KEY_AS_PATHNAME),
|
||||
RecursiveIteratorIterator::SELF_FIRST) as $directory => $info) {
|
||||
'/^(?!.*(\.svn|\.cvs)).*$/', RecursiveRegexIterator::MATCH
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($iterator as $directory => $info) {
|
||||
$file = $info->getFilename();
|
||||
if (is_array($options['ignore'])) {
|
||||
foreach ($options['ignore'] as $key => $ignore) {
|
||||
@ -315,6 +320,8 @@ abstract class Zend_Translate_Adapter {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($iterator);
|
||||
} else {
|
||||
$this->_addTranslationData($options);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_Version
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Version.php 24209 2011-07-06 21:38:42Z matthew $
|
||||
* @version $Id: Version.php 24230 2011-07-13 17:44:57Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -32,7 +32,7 @@ final class Zend_Version
|
||||
/**
|
||||
* Zend Framework version identification - see compareVersion()
|
||||
*/
|
||||
const VERSION = '1.11.8';
|
||||
const VERSION = '1.11.9';
|
||||
|
||||
/**
|
||||
* The latest stable version Zend Framework available
|
||||
|
Loading…
x
Reference in New Issue
Block a user