Commit 331eeabf authored by Radek Suski's avatar Radek Suski

handling for encryption prefix.

parent a2d1ee33
......@@ -20,12 +20,14 @@ namespace Sobi\Utils;
defined( 'SOBI' ) || exit( 'Restricted access' );
use Sobi\Error\Exception;
use Sobi\Framework;
class Serialiser
{
/**
* @param string $var
* @param null $name
*
* @throws Exception
* @return mixed
*/
......@@ -63,6 +65,7 @@ class Serialiser
/**
* @param mixed $var
*
* @return string
*/
public static function Serialise( $var )
......@@ -83,6 +86,7 @@ class Serialiser
/**
* @param $data
* @param bool $force
*
* @return array|mixed
*/
public static function StructuralData( $data, $force = false )
......@@ -107,6 +111,9 @@ class Serialiser
$data = str_getcsv( $struct[ 1 ] );
}
break;
case 'encrypted':
$data = Encryption::Decrypt( $struct[ 1 ], Framework::Cfg( 'encryption.key' ) );
break;
}
}
elseif ( is_string( $data ) && $force ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment