Permalink
Browse files

Remove unncessary TextEncoding calls

  • Loading branch information...
1 parent 5009b52 commit d7f4b6f366665c580beaee0a3723fdacaa2a0b99 @cdujeu cdujeu committed Sep 6, 2016
@@ -96,19 +96,12 @@ public function switchAction($action, $httpVars, $fileVars, ContextInterface $ct
$$getName = InputFilter::securePath($getValue);
}
$selection = UserSelection::fromContext($ctx, $httpVars);
- if (isSet($dir) && $action != "upload") {
- $safeDir = $dir;
- $dir = TextEncoder::fromUTF8($dir);
- }
// FILTER DIR PAGINATION ANCHOR
if (isSet($dir) && strstr($dir, "%23")!==false) {
$parts = explode("%23", $dir);
$dir = $parts[0];
$page = $parts[1];
}
- if (isSet($dest)) {
- $dest = TextEncoder::fromUTF8($dest);
- }
// Sanitize all httpVars entries
foreach($httpVars as $k=>&$value){
@@ -138,7 +131,7 @@ public function switchAction($action, $httpVars, $fileVars, ContextInterface $ct
$index = 0;
foreach ($arrValues as $k=>$v) {
// CHECK IF AUTO KEY!!!
- $string .= "'".addslashes(TextEncoder::fromUTF8($v))."'";
+ $string .= "'".addslashes($v)."'";
if($index < count($arrValues)-1) $string.=",";
$index++;
}
@@ -150,7 +143,7 @@ public function switchAction($action, $httpVars, $fileVars, ContextInterface $ct
if ($k == $pkName) {
$pkValue = $v;
} else {
- $string .= $k."='".addslashes(TextEncoder::fromUTF8($v))."'";
+ $string .= $k."='".addslashes($v)."'";
if($index<count($arrValues)-1) $string.=",";
}
$index++;
@@ -428,7 +421,7 @@ public function switchAction($action, $httpVars, $fileVars, ContextInterface $ct
$value = str_replace("\"", "", $value);
if(InputFilter::detectXSS($value)) $value = "Possible XSS Detected - Cannot display value!";
$value = StringHelper::xmlEntities($value);
- print $key.'="'.TextEncoder::toUTF8($value).'" ';
+ print $key.'="'.$value.'" ';
if ($result["HAS_PK"]>0) {
if (in_array($key, $result["PK_FIELDS"])) {
$pkString .= $key."__".$value.".";
@@ -165,7 +165,7 @@ protected function appendUploadedData($folder, $source, $target){
* @param string $type
* @return bool
*/
- public function isWriteable($dir, $type="dir")
+ public function isWriteable(AJXP_Node $node)
{
return true;
}
@@ -255,9 +255,6 @@ public static function migrateLegacyMeta(ContextInterface $ctx, $shareCenter, $s
$newRepo->setGroupPath($gPath);
}
$newRepo->setDescription("");
- // Smells like dirty hack!
- $newRepo->options["PATH"] = TextEncoder::fromStorageEncoding($newRepo->options["PATH"]);
-
$newRepo->setContentFilter(new ContentFilter([new AJXP_Node("pydio://".$ctx->getUser()->getId()."@".$parentRepositoryObject->getId().$filePath)]));
if(!$dryRun){
RepositoryService::addRepository($newRepo);
@@ -1229,7 +1229,6 @@ private function findMirrorNodesInShares($node, $direction){
}
$parentRoot = $parentRepository->getContextOption($newContext, "PATH");
$relative = substr($currentRoot, strlen($parentRoot));
- $relative = TextEncoder::toStorageEncoding($relative);
$parentNodeURL = $newContext->getUrlBase().$relative.$node->getPath();
$this->logDebug("action.share", "Should trigger on ".$parentNodeURL);
$parentNode = new AJXP_Node($parentNodeURL);
@@ -1519,9 +1518,6 @@ protected function createOrLoadSharedRepository($httpVars, &$update){
$newRepo->setGroupPath($gPath);
}
$newRepo->setDescription($description);
- // Smells like dirty hack!
- $newRepo->options["PATH"] = TextEncoder::fromStorageEncoding($newRepo->options["PATH"]);
-
if(isSet($httpVars["filter_nodes"])){
$newRepo->setContentFilter(new ContentFilter($httpVars["filter_nodes"]));
}
@@ -212,7 +212,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
'apikey' => $this->getContextualOption($ctx, "ZOHO_API_KEY"),
'output' => 'url',
'lang' => $this->getContextualOption($ctx, "ZOHO_LANGUAGE"),
- 'filename' => TextEncoder::toUTF8(basename($file)),
+ 'filename' => basename($file),
'persistence' => 'false',
'format' => $extension,
'mode' => $repoWriteable && is_writeable($nodeUrl) ? 'normaledit' : 'view',

0 comments on commit d7f4b6f

Please sign in to comment.