From a1669b2a7f2f681b1484a9e329c54f2d070bb69c Mon Sep 17 00:00:00 2001 From: David Date: Wed, 15 Jan 2014 13:12:07 +0100 Subject: Fix: do json_decode before decoding UTF8 to globalisations charset (Fixes 492) --- framework/Web/UI/ActiveControls/TActivePageAdapter.php | 5 ++--- framework/Web/UI/TPage.php | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'framework') diff --git a/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/framework/Web/UI/ActiveControls/TActivePageAdapter.php index 8fd39766..bce3beb0 100644 --- a/framework/Web/UI/ActiveControls/TActivePageAdapter.php +++ b/framework/Web/UI/ActiveControls/TActivePageAdapter.php @@ -294,7 +294,7 @@ class TActivePageAdapter extends TControlAdapter } /** - * Gets callback parameter. JSON encoding is assumed. + * Gets callback parameter. * @return string postback event parameter */ public function getCallbackEventParameter() @@ -302,8 +302,7 @@ class TActivePageAdapter extends TControlAdapter if($this->_callbackEventParameter===null) { $param = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER); - if(strlen($param) > 0) - $this->_callbackEventParameter=TJavaScript::jsonDecode((string)$param); + $this->_callbackEventParameter=$param; } return $this->_callbackEventParameter; } diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index 7f729543..2dc1cac3 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -302,6 +302,10 @@ class TPage extends TTemplateControl $this->setAdapter(new TActivePageAdapter($this)); + $callbackEventParameter = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER); + if(strlen($callbackEventParameter) > 0) + $this->_postData[TPage::FIELD_CALLBACK_PARAMETER]=TJavaScript::jsonDecode((string)$callbackEventParameter); + // Decode Callback postData from UTF-8 to current Charset if (($g=$this->getApplication()->getGlobalization(false))!==null && strtoupper($enc=$g->getCharset())!='UTF-8') -- cgit v1.2.3