Skip to content

Commit

Permalink
Merge pull request #214 from portabilis/portabilis-patch-2018-06-08
Browse files Browse the repository at this point in the history
Portabilis Patch 08/06/2018
  • Loading branch information
MarceloCajueiro authored Jun 8, 2018
2 parents d11f6ce + c316c05 commit 34aaccf
Show file tree
Hide file tree
Showing 12 changed files with 1,363 additions and 1,203 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"require": {
"portabilis/jasperphp": "v1.2.0",
"robmorgan/phinx": "v0.8.1",
"gilbitron/php-simplecache": "^1.4"
"gilbitron/php-simplecache": "^1.4",
"cocur/slugify": "^3.1"
}
}
197 changes: 160 additions & 37 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

require_once 'include/pmieducar/geral.inc.php';
require_once 'lib/Utils/SafeJson.php';

/**
* clsModulesAuditoriaGeral class.
Expand Down Expand Up @@ -108,7 +109,7 @@ function removeKeysDesnecessarias($dados) {
function converteArrayDadosParaJson($dados) {
$dados = $this->removeKeyNaoNumerica($dados);
$dados = $this->removeKeysDesnecessarias($dados);
$dados = json_encode($dados);
$dados = SafeJson::encode($dados);
$dados = str_replace("'", "''", $dados);
return $dados;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

require_once 'include/pmieducar/geral.inc.php';
require_once 'lib/Utils/SafeJson.php';

/**
* clsPmieducarConfiguracoesGerais class.
Expand Down Expand Up @@ -234,7 +235,7 @@ function edita()
}

if (is_array($this->custom_labels)) {
$customLabels = json_encode($this->custom_labels);
$customLabels = SafeJson::encode($this->custom_labels);
$set[] = "custom_labels = '{$customLabels}'";
}

Expand Down
5 changes: 3 additions & 2 deletions ieducar/lib/Portabilis/Controller/ApiCoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
require_once 'lib/Portabilis/Utils/Database.php';
require_once 'lib/Portabilis/String/Utils.php';
require_once 'lib/Portabilis/Utils/User.php';
require_once 'lib/Utils/SafeJson.php';

class ApiCoreController extends Core_Controller_Page_EditController
{
Expand Down Expand Up @@ -255,14 +256,14 @@ protected function prepareResponse(){
$this->appendResponse('msgs', $this->messenger->getMsgs());
$this->appendResponse('any_error_msg', $this->messenger->hasMsgWithType('error'));

$response = json_encode($this->response);
$response = SafeJson::encode($this->response);
}
catch (Exception $e){
error_log("Erro inesperado no metodo prepareResponse da classe ApiCoreController: {$e->getMessage()}");
$response = array('msgs' => array('msg' => 'Erro inesperado no servidor. Por favor, tente novamente.',
'type' => 'error'));

$response = json_encode($response);
$response = SafeJson::encode($response);
}

echo $response;
Expand Down
Loading

0 comments on commit 34aaccf

Please sign in to comment.