作者:JackyKi
项目:revive-adserve
function MAX_commonDeriveSource($source)
{
return MAX_commonEncrypt(trim(urldecode($source)));
}
作者:Spark-Eleve
项目:revive-adserve
/**
* Test the _MAX_commonEncrypt and _MAX_commonDecrypt functions.
*/
function test_MAX_commonEncryptDecrypt()
{
$this->sendMessage('test_MAX_commonEncryptDecrypt');
$string = 'Lorem ipsum dolor sit amet ipso facto';
$GLOBALS['_MAX']['CONF']['delivery']['obfuscate'] = 1;
$retEnc = MAX_commonEncrypt($string);
$this->assertNotEqual($retEnc, $string);
$retDec = MAX_commonDecrypt($retEnc);
$this->assertNotEqual($retDec, $retEnc);
$this->assertEqual($retDec, $string);
$GLOBALS['_MAX']['CONF']['delivery']['obfuscate'] = 0;
$retDec = MAX_commonDecrypt($string);
$this->assertEqual($retDec, $string);
}