summaryrefslogtreecommitdiffstats
path: root/lib/files/view.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-23 16:34:58 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-23 16:37:46 +0200
commit56c7ee799cb13f7a4db60663f60b76cdf223614b (patch)
tree4c3fad91604eb3c0cb987f4938cee332838ab25a /lib/files/view.php
parent7424f3aef6ecdb1b62f4ab4ff0d23ade9011ad77 (diff)
downloadnextcloud-server-56c7ee799cb13f7a4db60663f60b76cdf223614b.tar.gz
nextcloud-server-56c7ee799cb13f7a4db60663f60b76cdf223614b.zip
use strtotime on non-nummeric times in oc_filesystem::touch
Diffstat (limited to 'lib/files/view.php')
-rw-r--r--lib/files/view.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/files/view.php b/lib/files/view.php
index a59ad8105d6..18d9193035e 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -110,7 +110,7 @@ class View {
*/
public function getLocalFile($path) {
$parent = substr($path, 0, strrpos($path, '/'));
- list($storage, $internalPath)=\OC\Files\Filesystem::resolvePath($path);
+ list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($path);
if (Filesystem::isValidPath($parent) and $storage) {
return $storage->getLocalFile($internalPath);
} else {
@@ -124,7 +124,7 @@ class View {
*/
public function getLocalFolder($path) {
$parent = substr($path, 0, strrpos($path, '/'));
- list($storage, $internalPath)=\OC\Files\Filesystem::resolvePath($path);
+ list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($path);
if (Filesystem::isValidPath($parent) and $storage) {
return $storage->getLocalFolder($internalPath);
} else {
@@ -227,6 +227,9 @@ class View {
}
public function touch($path, $mtime = null) {
+ if (!is_null($mtime) and !is_numeric($mtime)) {
+ $mtime = strtotime($mtime);
+ }
return $this->basicOperation('touch', $path, array('write'), $mtime);
}
@@ -331,8 +334,8 @@ class View {
$mp1 = $this->getMountPoint($path1 . $postFix1);
$mp2 = $this->getMountPoint($path2 . $postFix2);
if ($mp1 == $mp2) {
- list($storage, $internalPath1)=\OC\Files\Filesystem::resolvePath($path1 . $postFix1);
- list( , $internalPath2)=\OC\Files\Filesystem::resolvePath($path2 . $postFix2);
+ list($storage, $internalPath1) = \OC\Files\Filesystem::resolvePath($path1 . $postFix1);
+ list(, $internalPath2) = \OC\Files\Filesystem::resolvePath($path2 . $postFix2);
if ($storage) {
$result = $storage->rename($internalPath1, $internalPath2);
} else {
@@ -342,7 +345,7 @@ class View {
$source = $this->fopen($path1 . $postFix1, 'r');
$target = $this->fopen($path2 . $postFix2, 'w');
$count = \OC_Helper::streamCopy($source, $target);
- list($storage1, $internalPath1)=\OC\Files\Filesystem::resolvePath($path1 . $postFix1);
+ list($storage1, $internalPath1) = \OC\Files\Filesystem::resolvePath($path1 . $postFix1);
$storage1->unlink($internalPath1);
$result = $count > 0;
}
@@ -414,8 +417,8 @@ class View {
$mp1 = $this->getMountPoint($path1 . $postFix1);
$mp2 = $this->getMountPoint($path2 . $postFix2);
if ($mp1 == $mp2) {
- list($storage, $internalPath1)=\OC\Files\Filesystem::resolvePath($path1 . $postFix1);
- list( , $internalPath2)=\OC\Files\Filesystem::resolvePath($path2 . $postFix2);
+ list($storage, $internalPath1) = \OC\Files\Filesystem::resolvePath($path1 . $postFix1);
+ list(, $internalPath2) = \OC\Files\Filesystem::resolvePath($path2 . $postFix2);
if ($storage) {
$result = $storage->copy($internalPath1, $internalPath2);
} else {
@@ -550,7 +553,7 @@ class View {
array(Filesystem::signal_param_path => $path)
);
}
- list($storage, $internalPath)=\OC\Files\Filesystem::resolvePath($path . $postFix);
+ list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($path . $postFix);
if ($storage) {
$result = $storage->hash($type, $internalPath, $raw);
$result = \OC_FileProxy::runPostProxies('hash', $absolutePath, $result);
@@ -585,7 +588,7 @@ class View {
return false;
}
$run = $this->runHooks($hooks, $path);
- list($storage, $internalPath)=\OC\Files\Filesystem::resolvePath($path . $postFix);
+ list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($path . $postFix);
if ($run and $storage) {
if (!is_null($extraParam)) {
$result = $storage->$operation($internalPath, $extraParam);