Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix wrong call to magicDequote
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 9, 2016
1 parent 6df6966 commit 0a5b478
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions core/src/plugins/access.ajxp_conf/src/RepositoriesManager.php
Expand Up @@ -44,9 +44,9 @@
use Pydio\Core\Services\RepositoryService;
use Pydio\Core\Services\RolesService;
use Pydio\Core\Services\UsersService;
use Pydio\Core\Utils\TextEncoder;
use Pydio\Core\Utils\Vars\InputFilter;
use Pydio\Core\Utils\Vars\StringHelper;
use Pydio\Tests\AbstractTest;
use Zend\Diactoros\Response\JsonResponse;

defined('AJXP_EXEC') or die('Access not allowed');
Expand Down Expand Up @@ -120,7 +120,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
unset($repDef["get_action"]);
unset($repDef["sf_checkboxes_active"]);
if (isSet($httpVars["json_data"])) {
$repDef = json_decode(TextEncoder::magicDequote($httpVars["json_data"]), true);
$repDef = json_decode(InputFilter::magicDequote($httpVars["json_data"]), true);
$options = $repDef["DRIVER_OPTIONS"];
} else {
$options = array();
Expand Down Expand Up @@ -245,6 +245,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
$className = "\\Pydio\\Tests\\".$repo->getAccessType()."AccessTest";
if (!class_exists($className))
include($testFile);
/** @var AbstractTest $class */
$class = new $className();
$result = $class->doRepositoryTest($repo);
if (!$result) {
Expand All @@ -254,7 +255,6 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
if ($driver != null && $driver->getConfigs() != null) {
$arrayDefaultMetasources = array();
$arrayPluginToOverWrite = array();
$arrayPluginToAdd = array();
$metaSourceOptions = array();
$configsDriver = $driver->getConfigs();
if (!empty($configsDriver["DEFAULT_METASOURCES"])) {
Expand Down Expand Up @@ -346,7 +346,6 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
$driver = $pluginService->getPluginByTypeName("access", $repo->getAccessType());
if ($driver != null && $driver->getConfigs() != null) {
$arrayPluginToOverWrite = array();
$arrayPluginToAdd = array();
$arrayWorkspaceMetasources = $repo->getSafeOption("META_SOURCES");
if(isSet($jsonDataEditWorkspace["features"])) {
foreach($arrayWorkspaceMetasources as $metaSourcePluginName => $metaSourcePluginArray) {
Expand All @@ -373,7 +372,6 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
$message = new UserMessage("Workspace successfully edited !!");
$reload = new ReloadMessage("", $repo->getUniqueId());
$responseInterface = $responseInterface->withBody(new SerializableResponseStream([$message, $reload]));
$varToDelete = "EOF";
break;

case "edit_repository_label" :
Expand Down Expand Up @@ -476,6 +474,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
chdir(AJXP_TESTS_FOLDER."/plugins");
include(AJXP_TESTS_FOLDER."/plugins/test.ajxp_".$repo->getAccessType().".php");
$className = "ajxp_".$repo->getAccessType();
/** @var AbstractTest $class */
$class = new $className();
$result = $class->doRepositoryTest($repo);
if (!$result) {
Expand Down Expand Up @@ -586,7 +585,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
if(isSet($httpVars["request_body"])){
$options = $httpVars["request_body"];
}else if (isSet($httpVars["json_data"])) {
$options = json_decode(TextEncoder::magicDequote($httpVars["json_data"]), true);
$options = json_decode(InputFilter::magicDequote($httpVars["json_data"]), true);
} else {
$options = array();
$this->parseParameters($ctx, $httpVars, $options, true);
Expand Down Expand Up @@ -639,7 +638,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
throw new PydioException("Invalid workspace id! $repId");
}
if (isSet($httpVars["bulk_data"])) {
$bulkData = json_decode(TextEncoder::magicDequote($httpVars["bulk_data"]), true);
$bulkData = json_decode(InputFilter::magicDequote($httpVars["bulk_data"]), true);
$repoOptions = $repo->getContextOption($ctx, "META_SOURCES");
if (!is_array($repoOptions)) {
$repoOptions = array();
Expand Down Expand Up @@ -670,7 +669,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
if(isSet($httpVars["request_body"])){
$options = $httpVars["request_body"];
}else if (isSet($httpVars["json_data"])) {
$options = json_decode(TextEncoder::magicDequote($httpVars["json_data"]), true);
$options = json_decode(InputFilter::magicDequote($httpVars["json_data"]), true);
} else {
$options = array();
$this->parseParameters($ctx, $httpVars, $options, true);
Expand Down

0 comments on commit 0a5b478

Please sign in to comment.