Beispiel #1
0
function MAX_commonDeriveSource($source)
{
    return MAX_commonEncrypt(trim(urldecode($source)));
}
 /**
  * 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);
 }