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

Commit

Permalink
Remove unncessary TextEncoding calls
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 6, 2016
1 parent 5009b52 commit d7f4b6f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
13 changes: 3 additions & 10 deletions core/src/plugins/access.mysql/MysqlAccessDriver.php
Expand Up @@ -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){
Expand Down Expand Up @@ -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++;
}
Expand All @@ -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++;
Expand Down Expand Up @@ -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.".";
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/access.s3/S3AccessDriver.php
Expand Up @@ -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;
}
Expand Down
3 changes: 0 additions & 3 deletions core/src/plugins/action.share/src/Legacy/LegacyPubliclet.php
Expand Up @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions core/src/plugins/action.share/src/ShareCenter.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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"]));
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/editor.zoho/ZohoEditor.php
Expand Up @@ -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',
Expand Down

0 comments on commit d7f4b6f

Please sign in to comment.