diff options
Diffstat (limited to 'framework/Web/UI/TPageStatePersister.php')
-rw-r--r-- | framework/Web/UI/TPageStatePersister.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/framework/Web/UI/TPageStatePersister.php b/framework/Web/UI/TPageStatePersister.php index 49321ff5..90af9665 100644 --- a/framework/Web/UI/TPageStatePersister.php +++ b/framework/Web/UI/TPageStatePersister.php @@ -55,12 +55,13 @@ class TPageStatePersister extends TComponent implements IPageStatePersister public function save($state)
{
Prado::trace("Saving state",'System.Web.UI.TPageStatePersister');
+ $sm=Prado::getApplication()->getSecurityManager();
if($this->_page->getEnableStateValidation())
- $data=$this->getApplication()->getSecurityManager()->hashData(Prado::serialize($state));
+ $data=$sm->hashData(Prado::serialize($state));
else
$data=Prado::serialize($state);
if($this->_page->getEnableStateEncryption())
- $data=$this->getApplication()->getSecurityManager()->encrypt($data);
+ $data=$sm->encrypt($data);
if(extension_loaded('zlib'))
$data=gzcompress($data);
$this->_page->getClientScript()->registerHiddenField(TPage::FIELD_PAGESTATE,base64_encode($data));
@@ -74,7 +75,9 @@ class TPageStatePersister extends TComponent implements IPageStatePersister public function load()
{
Prado::trace("Loading state",'System.Web.UI.TPageStatePersister');
- $str=base64_decode($this->getRequest()->itemAt(TPage::FIELD_PAGESTATE));
+ $application=Prado::getApplication();
+ $sm=$application->getSecurityManager();
+ $str=base64_decode($application->getRequest()->itemAt(TPage::FIELD_PAGESTATE));
if($str==='')
return null;
if(extension_loaded('zlib'))
@@ -84,10 +87,10 @@ class TPageStatePersister extends TComponent implements IPageStatePersister if($data!==false)
{
if($this->_page->getEnableStateEncryption())
- $data=$this->getApplication()->getSecurityManager()->decrypt($data);
+ $data=$sm->decrypt($data);
if($this->_page->getEnableStateValidation())
{
- if(($data=$this->getApplication()->getSecurityManager()->validateData($data))!==false)
+ if(($data=$sm->validateData($data))!==false)
return Prado::unserialize($data);
}
else
|