framework/base/CSecurityManager.php
public function validateData($data,$key=null)
	{
		if (!is_string($data))
			return false;

		$len=$this->strlen($this->computeHMAC('test'));
		if($this->strlen($data)>=$len)
		{
			$hmac=$this->substr($data,0,$len);
			$data2=$this->substr($data,$len,$this->strlen($data));
			return $this->compareString($hmac,$this->computeHMAC($data2,$key))?$data2:false;
		}
		else
			return false;
	}
public function validateData($data,$key=null)
	{
		if (!is_string($data))
			return false;

		$len=$this->strlen($this->computeHMAC('test'));
		if($this->strlen($data)>=$len)
		{
			$hmac=$this->substr($data,0,$len);
			$data2=$this->substr($data,$len,$this->strlen($data));
			return $this->compareString($hmac,$this->computeHMAC($data2,$key))?$data2:false;
		}
		else
			return false;
	}
public function validateData ( $ data , $ key = null ) { if ( ! is_string ( $ data ) ) return false ; $ len = $ this -> strlen ( $ this -> computeHMAC ( 'test' ) ) ; if ( $ this -> strlen ( $ data ) >= $ len ) { $ hmac = $ this -> substr ( $ data , 0 , $ len ) ; $ data2 = $ this -> substr ( $ data , $ len , $ this -> strlen ( $ data ) ) ; return $ this -> compareString ( $ hmac , $ this -> computeHMAC ( $ data2 , $ key ) ) ? $ data2 : false ; } else return false ; }
Validates if data is tampered.
@param string $data data to be validated. The data must be previously
generated using {@link hashData()}.
@param string $key the private key to be used for generating HMAC. Defaults to null, meaning using {@link validationKey}.
@return string the real data with HMAC stripped off. False if the data
is tampered.
Validates if data is tampered .