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

Commit cfd28f2

Browse files
committed
clean getRealFSReference usages
1 parent 4009ea1 commit cfd28f2

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

core/src/plugins/editor.pixlr/PixlrEditor.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
9898
}
9999

100100
$target = rtrim(base64_decode($httpVars["parent_url"]), '/') ."/plugins/editor.pixlr";
101-
$tmp = MetaStreamWrapper::getRealFSReference($selectedNodeUrl);
102-
//$tmp = TextEncoder::fromUTF8($tmp);
103101
$this->logInfo('Preview', 'Sending content of '.$selectedNodeUrl.' to Pixlr server.', array("files" => $selectedNodeUrl));
104102
Controller::applyHook("node.read", array($selectedNode));
105103

@@ -108,8 +106,8 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
108106
$saveTarget = $target."/fake_save_pixlr_".md5($httpVars["secure_token"]).".php";
109107
}
110108

111-
$type = pathinfo($tmp, PATHINFO_EXTENSION);
112-
$data = file_get_contents($tmp);
109+
$type = pathinfo($selectedNodeUrl, PATHINFO_EXTENSION);
110+
$data = file_get_contents($selectedNodeUrl);
113111
$rawData = 'data:image/' . $type . ';base64,' . base64_encode($data);
114112

115113
$params = [

core/src/plugins/editor.zoho/ZohoEditor.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
175175
}
176176

177177
$target = base64_decode($httpVars["parent_url"]);
178-
$tmp = MetaStreamWrapper::getRealFSReference($nodeUrl);
179178

180179
$node = new AJXP_Node($nodeUrl);
181180
Controller::applyHook("node.read", array($node));
@@ -203,6 +202,8 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
203202
$service = "exportwriter";
204203
}
205204

205+
$contentHandle = fopen($nodeUrl, 'r');
206+
206207
$postResponse = $this->client->post("https://".$service.".zoho.com/remotedoc.im", [
207208
'headers' => [
208209
'User-Agent' => $request->getHeader('User-Agent')
@@ -217,7 +218,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
217218
'format' => $extension,
218219
'mode' => $repoWriteable && is_writeable($nodeUrl) ? 'normaledit' : 'view',
219220
'saveurl' => $saveUrl."?signature=".$b64Sig."&XDEBUG_SESSION_START=phpstorm",
220-
'content' => fopen($tmp, 'r')
221+
'content' => fopen($nodeUrl, 'r')
221222
]
222223
]);
223224

@@ -236,6 +237,8 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
236237
throw new FileNotFoundException("Could not open file");
237238
}
238239

240+
fclose($contentHandle);
241+
239242
$response = $response
240243
->withStatus(302)
241244
->withHeader("Location", $result["URL"]);

core/src/plugins/meta.exif/ExifMetaManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function extractExif(\Psr\Http\Message\ServerRequestInterface $requestInt
135135
$ctx = $requestInterface->getAttribute("ctx");
136136
$userSelection = UserSelection::fromContext($ctx, $httpVars);
137137
$selectedNode = $userSelection->getUniqueNode();
138-
$realFile = MetaStreamWrapper::getRealFSReference($selectedNode->getUrl());
138+
$realFile = $selectedNode->getRealFile();
139139

140140
ApplicationState::safeIniSet('exif.encode_unicode', 'UTF-8');
141141
$exifData = @exif_read_data($realFile, 0, TRUE);

0 commit comments

Comments
 (0)