summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-02-09 07:09:38 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-02-09 07:09:38 -0800
commit4bd1ff360b3a5a7154f55e861429f8179e3d9c89 (patch)
tree39bea6903fd7cb8ddfd4f6ab5b9613ffe3f2d570
parent9d7920755d742c93fe50410cd8abf37ede00fb7f (diff)
parentf8b103fb131e8657ac4ef16eace440193531fda2 (diff)
downloadnextcloud-server-4bd1ff360b3a5a7154f55e861429f8179e3d9c89.tar.gz
nextcloud-server-4bd1ff360b3a5a7154f55e861429f8179e3d9c89.zip
Merge pull request #1567 from owncloud/fixing-1505-stable45
know your libraries ;-)
-rw-r--r--lib/filesystemview.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/filesystemview.php b/lib/filesystemview.php
index 7dde0f7bf2b..f21192f0130 100644
--- a/lib/filesystemview.php
+++ b/lib/filesystemview.php
@@ -431,7 +431,7 @@ class OC_FilesystemView {
$result = OC_Helper::streamCopy($source, $target);
}
if( $this->fakeRoot==OC_Filesystem::getRoot() ){
- // If the file to be copied originates within
+ // If the file to be copied originates within
// the user's data directory
OC_Hook::emit(
@@ -517,11 +517,7 @@ class OC_FilesystemView {
if(OC_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;