Skip to content
Snippets Groups Projects
Commit ddc7af9a authored by Thomas Müller's avatar Thomas Müller
Browse files

know your libraries ;-)

strrpos fails in cases the file in the path has no dot but the parent folder
parent 0c73cae7
No related branches found
No related tags found
No related merge requests found
......@@ -509,11 +509,7 @@ class View {
if (Filesystem::isValidPath($path)) {
$source = $this->fopen($path, 'r');
if ($source) {
$extension = '';
$extOffset = strpos($path, '.');
if ($extOffset !== false) {
$extension = substr($path, strrpos($path, '.'));
}
$extension = pathinfo($path, PATHINFO_EXTENSION);
$tmpFile = \OC_Helper::tmpFile($extension);
file_put_contents($tmpFile, $source);
return $tmpFile;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment