Navigation Menu

Skip to content

Commit

Permalink
Change from json to base64 encode/decode, to prevent transforming spe…
Browse files Browse the repository at this point in the history
…cial chars.
  • Loading branch information
johndwells committed Jul 19, 2012
1 parent 93ff479 commit d4dd543
Showing 1 changed file with 4 additions and 8 deletions.
Expand Up @@ -36,10 +36,6 @@ public function __construct()

$this->EE->load->library('javascript');
$this->EE->load->library('typography');
if (!function_exists('json_decode')) {
$this->load->library('Services_json');
}


// Create cache
if (!isset($this->EE->session->cache[__CLASS__])) {
Expand Down Expand Up @@ -344,25 +340,25 @@ function display_cell($field_data) {
*/
function save($data)
{
return $this->EE->javascript->generate_json($data, TRUE);
return base64_encode(serialize($data));
}

/**
* Save Cell
*/
function save_cell($data)
{
return $this->EE->javascript->generate_json($data, TRUE);
return $this->save($data);
}


// --------------------------------------------------------------------

/*
* Pre-parse to decode from JSON
* Pre-parse to decode data
*/
function pre_process($data) {
return json_decode(htmlspecialchars_decode($data),true);
return unserialize(base64_decode($data));
} // end pre_process($data)

/**
Expand Down

0 comments on commit d4dd543

Please sign in to comment.