summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-05-15 23:51:13 +0200
committerThomas Mueller <thomas.mueller@tmit.eu>2013-05-15 23:51:13 +0200
commit195f6143a3e5654418f28b5640df279fc81c8127 (patch)
tree3966312dfa60f4990547ebab62c9d40f0a88d3a6 /lib
parent83444d9c641b77144cd74e5dc71c5ad18964944e (diff)
parentdfddaf8fbf5ff515f26ff462c7ba6166b3d0ed18 (diff)
downloadnextcloud-server-195f6143a3e5654418f28b5640df279fc81c8127.tar.gz
nextcloud-server-195f6143a3e5654418f28b5640df279fc81c8127.zip
Merge branch 'master' into convert-oc_config
Diffstat (limited to 'lib')
-rw-r--r--lib/MDB2/Driver/sqlite3.php2
-rw-r--r--lib/autoloader.php126
-rw-r--r--lib/base.php69
-rw-r--r--lib/files/cache/backgroundwatcher.php104
-rw-r--r--lib/files/cache/cache.php25
-rw-r--r--lib/files/cache/permissions.php15
-rw-r--r--lib/files/cache/scanner.php10
-rw-r--r--lib/files/cache/updater.php9
-rw-r--r--lib/files/filesystem.php5
-rw-r--r--lib/files/view.php20
-rw-r--r--lib/l10n/de.php2
-rw-r--r--lib/l10n/ug.php19
-rw-r--r--lib/legacy/filesystem.php (renamed from lib/filesystem.php)0
-rw-r--r--lib/legacy/filesystemview.php (renamed from lib/filesystemview.php)0
-rw-r--r--lib/setup.php1
-rw-r--r--lib/templatelayout.php2
-rwxr-xr-xlib/util.php3
-rw-r--r--lib/vobject/compoundproperty.php70
18 files changed, 396 insertions, 86 deletions
diff --git a/lib/MDB2/Driver/sqlite3.php b/lib/MDB2/Driver/sqlite3.php
index aef0eab9bf1..693ceffa01c 100644
--- a/lib/MDB2/Driver/sqlite3.php
+++ b/lib/MDB2/Driver/sqlite3.php
@@ -387,7 +387,7 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common
$php_errormsg = '';
$this->connection = new SQLite3($database_file);
if(is_callable(array($this->connection, 'busyTimeout'))) {//busy timout is only available in php>=5.3
- $this->connection->busyTimeout(100);
+ $this->connection->busyTimeout(60000);
}
$this->_lasterror = $this->connection->lastErrorMsg();
if (!$this->connection) {
diff --git a/lib/autoloader.php b/lib/autoloader.php
new file mode 100644
index 00000000000..9615838a9a2
--- /dev/null
+++ b/lib/autoloader.php
@@ -0,0 +1,126 @@
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC;
+
+class Autoloader {
+ private $useGlobalClassPath = true;
+
+ private $prefixPaths = array();
+
+ private $classPaths = array();
+
+ /**
+ * Add a custom prefix to the autoloader
+ *
+ * @param string $prefix
+ * @param string $path
+ */
+ public function registerPrefix($prefix, $path) {
+ $this->prefixPaths[$prefix] = $path;
+ }
+
+ /**
+ * Add a custom classpath to the autoloader
+ *
+ * @param string $class
+ * @param string $path
+ */
+ public function registerClass($class, $path) {
+ $this->classPaths[$class] = $path;
+ }
+
+ /**
+ * disable the usage of the global classpath \OC::$CLASSPATH
+ */
+ public function disableGlobalClassPath() {
+ $this->useGlobalClassPath = false;
+ }
+
+ /**
+ * enable the usage of the global classpath \OC::$CLASSPATH
+ */
+ public function enableGlobalClassPath() {
+ $this->useGlobalClassPath = true;
+ }
+
+ /**
+ * get the possible paths for a class
+ *
+ * @param string $class
+ * @return array|bool an array of possible paths or false if the class is not part of ownCloud
+ */
+ public function findClass($class) {
+ $class = trim($class, '\\');
+
+ $paths = array();
+ if (array_key_exists($class, $this->classPaths)) {
+ $paths[] = $this->classPaths[$class];
+ } else if ($this->useGlobalClassPath and array_key_exists($class, \OC::$CLASSPATH)) {
+ $paths[] = \OC::$CLASSPATH[$class];
+ /**
+ * @TODO: Remove this when necessary
+ * Remove "apps/" from inclusion path for smooth migration to mutli app dir
+ */
+ if (strpos(\OC::$CLASSPATH[$class], 'apps/') === 0) {
+ \OC_Log::write('core', 'include path for class "' . $class . '" starts with "apps/"', \OC_Log::DEBUG);
+ $paths[] = str_replace('apps/', '', \OC::$CLASSPATH[$class]);
+ }
+ } elseif (strpos($class, 'OC_') === 0) {
+ // first check for legacy classes if underscores are used
+ $paths[] = 'legacy/' . strtolower(str_replace('_', '/', substr($class, 3)) . '.php');
+ $paths[] = strtolower(str_replace('_', '/', substr($class, 3)) . '.php');
+ } elseif (strpos($class, 'OC\\') === 0) {
+ $paths[] = strtolower(str_replace('\\', '/', substr($class, 3)) . '.php');
+ } elseif (strpos($class, 'OCP\\') === 0) {
+ $paths[] = 'public/' . strtolower(str_replace('\\', '/', substr($class, 4)) . '.php');
+ } elseif (strpos($class, 'OCA\\') === 0) {
+ list(, $app, $rest) = explode('\\', $class, 3);
+ $app = strtolower($app);
+ foreach (\OC::$APPSROOTS as $appDir) {
+ if (stream_resolve_include_path($appDir['path'] . '/' . $app)) {
+ $paths[] = $appDir['path'] . '/' . $app . '/' . strtolower(str_replace('\\', '/', $rest) . '.php');
+ // If not found in the root of the app directory, insert '/lib' after app id and try again.
+ $paths[] = $appDir['path'] . '/' . $app . '/lib/' . strtolower(str_replace('\\', '/', $rest) . '.php');
+ }
+ }
+ } elseif (strpos($class, 'Test_') === 0) {
+ $paths[] = 'tests/lib/' . strtolower(str_replace('_', '/', substr($class, 5)) . '.php');
+ } elseif (strpos($class, 'Test\\') === 0) {
+ $paths[] = 'tests/lib/' . strtolower(str_replace('\\', '/', substr($class, 5)) . '.php');
+ } else {
+ foreach ($this->prefixPaths as $prefix => $dir) {
+ if (0 === strpos($class, $prefix)) {
+ $path = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
+ $path = str_replace('_', DIRECTORY_SEPARATOR, $path);
+ $paths[] = $dir . '/' . $path;
+ }
+ }
+ }
+ return $paths;
+ }
+
+ /**
+ * Load the specified class
+ *
+ * @param string $class
+ * @return bool
+ */
+ public function load($class) {
+ $paths = $this->findClass($class);
+
+ if (is_array($paths)) {
+ foreach ($paths as $path) {
+ if ($fullPath = stream_resolve_include_path($path)) {
+ require_once $fullPath;
+ }
+ }
+ }
+ return false;
+ }
+}
diff --git a/lib/base.php b/lib/base.php
index 8633ae9b637..667202d3aef 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -75,61 +75,9 @@ class OC {
protected static $router = null;
/**
- * SPL autoload
+ * @var \OC\Autoloader $loader
*/
- public static function autoload($className) {
- $className = trim($className, '\\');
-
- if (array_key_exists($className, OC::$CLASSPATH)) {
- $path = OC::$CLASSPATH[$className];
- /** @TODO: Remove this when necessary
- Remove "apps/" from inclusion path for smooth migration to mutli app dir
- */
- if (strpos($path, 'apps/') === 0) {
- OC_Log::write('core', 'include path for class "' . $className . '" starts with "apps/"', OC_Log::DEBUG);
- $path = str_replace('apps/', '', $path);
- }
- } elseif (strpos($className, 'OC_') === 0) {
- $path = strtolower(str_replace('_', '/', substr($className, 3)) . '.php');
- } elseif (strpos($className, 'OC\\') === 0) {
- $path = strtolower(str_replace('\\', '/', substr($className, 3)) . '.php');
- } elseif (strpos($className, 'OCP\\') === 0) {
- $path = 'public/' . strtolower(str_replace('\\', '/', substr($className, 3)) . '.php');
- } elseif (strpos($className, 'OCA\\') === 0) {
- foreach (self::$APPSROOTS as $appDir) {
- $path = strtolower(str_replace('\\', '/', substr($className, 4)) . '.php');
- $fullPath = stream_resolve_include_path($appDir['path'] . '/' . $path);
- if (file_exists($fullPath)) {
- require_once $fullPath;
- return false;
- }
- // If not found in the root of the app directory, insert '/lib' after app id and try again.
- $libpath = substr($path, 0, strpos($path, '/')) . '/lib' . substr($path, strpos($path, '/'));
- $fullPath = stream_resolve_include_path($appDir['path'] . '/' . $libpath);
- if (file_exists($fullPath)) {
- require_once $fullPath;
- return false;
- }
- }
- } elseif (strpos($className, 'Sabre_') === 0) {
- $path = str_replace('_', '/', $className) . '.php';
- } elseif (strpos($className, 'Symfony\\Component\\Routing\\') === 0) {
- $path = 'symfony/routing/' . str_replace('\\', '/', $className) . '.php';
- } elseif (strpos($className, 'Sabre\\VObject') === 0) {
- $path = str_replace('\\', '/', $className) . '.php';
- } elseif (strpos($className, 'Test_') === 0) {
- $path = 'tests/lib/' . strtolower(str_replace('_', '/', substr($className, 5)) . '.php');
- } elseif (strpos($className, 'Test\\') === 0) {
- $path = 'tests/lib/' . strtolower(str_replace('\\', '/', substr($className, 5)) . '.php');
- } else {
- return false;
- }
-
- if ($fullPath = stream_resolve_include_path($path)) {
- require_once $fullPath;
- }
- return false;
- }
+ public static $loader = null;
public static function initPaths() {
// calculate the root directories
@@ -396,8 +344,14 @@ class OC {
public static function init() {
// register autoloader
- spl_autoload_register(array('OC', 'autoload'));
- OC_Util::issetlocaleworking();
+ require_once __DIR__ . '/autoloader.php';
+ self::$loader=new \OC\Autoloader();
+ self::$loader->registerPrefix('Doctrine\\Common', 'doctrine/common/lib');
+ self::$loader->registerPrefix('Doctrine\\DBAL', 'doctrine/dbal/lib');
+ self::$loader->registerPrefix('Symfony\\Component\\Routing', 'symfony/routing');
+ self::$loader->registerPrefix('Sabre\\VObject', '3rdparty');
+ self::$loader->registerPrefix('Sabre_', '3rdparty');
+ spl_autoload_register(array(self::$loader, 'load'));
// set some stuff
//ob_start();
@@ -454,6 +408,7 @@ class OC {
}
self::initPaths();
+ OC_Util::issetlocaleworking();
// set debug mode if an xdebug session is active
if (!defined('DEBUG') || !DEBUG) {
@@ -643,7 +598,7 @@ class OC {
// Deny the redirect if the URL contains a @
// This prevents unvalidated redirects like ?redirect_url=:user@domain.com
- if (strpos($location, '@') === FALSE) {
+ if (strpos($location, '@') === false) {
header('Location: ' . $location);
return;
}
diff --git a/lib/files/cache/backgroundwatcher.php b/lib/files/cache/backgroundwatcher.php
new file mode 100644
index 00000000000..7549745e7d7
--- /dev/null
+++ b/lib/files/cache/backgroundwatcher.php
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Files\Cache;
+
+use \OC\Files\Mount;
+use \OC\Files\Filesystem;
+
+class BackgroundWatcher {
+ static $folderMimetype = null;
+
+ static private function getFolderMimetype() {
+ if (!is_null(self::$folderMimetype)) {
+ return self::$folderMimetype;
+ }
+ $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*mimetypes` WHERE `mimetype` = ?');
+ $result = $query->execute(array('httpd/unix-directory'));
+ $row = $result->fetchRow();
+ return $row['id'];
+ }
+
+ static private function checkUpdate($id) {
+ $cacheItem = Cache::getById($id);
+ if (is_null($cacheItem)) {
+ return;
+ }
+ list($storageId, $internalPath) = $cacheItem;
+ $mounts = Mount::findByStorageId($storageId);
+
+ if (count($mounts) === 0) {
+ //if the storage we need isn't mounted on default, try to find a user that has access to the storage
+ $permissionsCache = new Permissions($storageId);
+ $users = $permissionsCache->getUsers($id);
+ if (count($users) === 0) {
+ return;
+ }
+ Filesystem::initMountPoints($users[0]);
+ $mounts = Mount::findByStorageId($storageId);
+ if (count($mounts) === 0) {
+ return;
+ }
+ }
+ $storage = $mounts[0]->getStorage();
+ $watcher = new Watcher($storage);
+ $watcher->checkUpdate($internalPath);
+ }
+
+ /**
+ * get the next fileid in the cache
+ *
+ * @param int $previous
+ * @param bool $folder
+ * @return int
+ */
+ static private function getNextFileId($previous, $folder) {
+ if ($folder) {
+ $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `fileid` > ? AND mimetype = ' . self::getFolderMimetype() . ' ORDER BY `fileid` ASC', 1);
+ } else {
+ $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `fileid` > ? AND mimetype != ' . self::getFolderMimetype() . ' ORDER BY `fileid` ASC', 1);
+ }
+ $result = $query->execute(array($previous));
+ if ($row = $result->fetchRow()) {
+ return $row['fileid'];
+ } else {
+ return 0;
+ }
+ }
+
+ static public function checkNext() {
+ // check both 1 file and 1 folder, this way new files are detected quicker because there are less folders than files usually
+ $previousFile = \OC_Appconfig::getValue('files', 'backgroundwatcher_previous_file', 0);
+ $previousFolder = \OC_Appconfig::getValue('files', 'backgroundwatcher_previous_folder', 0);
+ $nextFile = self::getNextFileId($previousFile, false);
+ $nextFolder = self::getNextFileId($previousFolder, true);
+ \OC_Appconfig::setValue('files', 'backgroundwatcher_previous_file', $nextFile);
+ \OC_Appconfig::setValue('files', 'backgroundwatcher_previous_folder', $nextFolder);
+ if ($nextFile > 0) {
+ self::checkUpdate($nextFile);
+ }
+ if ($nextFolder > 0) {
+ self::checkUpdate($nextFolder);
+ }
+ }
+
+ static public function checkAll() {
+ $previous = 0;
+ $next = 1;
+ while ($next != 0) {
+ $next = self::getNextFileId($previous, true);
+ self::checkUpdate($next);
+ }
+ $previous = 0;
+ $next = 1;
+ while ($next != 0) {
+ $next = self::getNextFileId($previous, false);
+ self::checkUpdate($next);
+ }
+ }
+}
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php
index 47f3c272b13..8f5c9643bef 100644
--- a/lib/files/cache/cache.php
+++ b/lib/files/cache/cache.php
@@ -318,19 +318,22 @@ class Cache {
* @param string $target
*/
public function move($source, $target) {
- $sourceId = $this->getId($source);
+ $sourceData = $this->get($source);
+ $sourceId = $sourceData['fileid'];
$newParentId = $this->getParentId($target);
- //find all child entries
- $query = \OC_DB::prepare('SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `path` LIKE ?');
- $result = $query->execute(array($source . '/%'));
- $childEntries = $result->fetchAll();
- $sourceLength = strlen($source);
- $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ? WHERE `fileid` = ?');
-
- foreach ($childEntries as $child) {
- $targetPath = $target . substr($child['path'], $sourceLength);
- $query->execute(array($targetPath, md5($targetPath), $child['fileid']));
+ if ($sourceData['mimetype'] === 'httpd/unix-directory') {
+ //find all child entries
+ $query = \OC_DB::prepare('SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `path` LIKE ?');
+ $result = $query->execute(array($source . '/%'));
+ $childEntries = $result->fetchAll();
+ $sourceLength = strlen($source);
+ $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ? WHERE `fileid` = ?');
+
+ foreach ($childEntries as $child) {
+ $targetPath = $target . substr($child['path'], $sourceLength);
+ $query->execute(array($targetPath, md5($targetPath), $child['fileid']));
+ }
}
$query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ?, `name` = ?, `parent` =?'
diff --git a/lib/files/cache/permissions.php b/lib/files/cache/permissions.php
index a5c9c144054..faa5ff5eacc 100644
--- a/lib/files/cache/permissions.php
+++ b/lib/files/cache/permissions.php
@@ -107,4 +107,19 @@ class Permissions {
$query->execute(array($fileId, $user));
}
}
+
+ /**
+ * get the list of users which have permissions stored for a file
+ *
+ * @param int $fileId
+ */
+ public function getUsers($fileId) {
+ $query = \OC_DB::prepare('SELECT `user` FROM `*PREFIX*permissions` WHERE `fileid` = ?');
+ $result = $query->execute(array($fileId));
+ $users = array();
+ while ($row = $result->fetchRow()) {
+ $users[] = $row['user'];
+ }
+ return $users;
+ }
}
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index 5241acec1ee..661bc486330 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -62,7 +62,9 @@ class Scanner {
* @return array with metadata of the scanned file
*/
public function scanFile($file, $checkExisting = false) {
- if (!self::isIgnoredFile($file)) {
+ if ( ! self::isPartialFile($file)
+ and ! \OC\Files\Filesystem::isFileBlacklisted($file)
+ ) {
\OC_Hook::emit('\OC\Files\Cache\Scanner', 'scan_file', array('path' => $file, 'storage' => $this->storageId));
$data = $this->getData($file);
if ($data) {
@@ -166,10 +168,8 @@ class Scanner {
* @param String $file
* @return boolean
*/
- public static function isIgnoredFile($file) {
- if (pathinfo($file, PATHINFO_EXTENSION) === 'part'
- || \OC\Files\Filesystem::isFileBlacklisted($file)
- ) {
+ public static function isPartialFile($file) {
+ if (pathinfo($file, PATHINFO_EXTENSION) === 'part') {
return true;
}
return false;
diff --git a/lib/files/cache/updater.php b/lib/files/cache/updater.php
index 92a16d9d9b6..417a47f3830 100644
--- a/lib/files/cache/updater.php
+++ b/lib/files/cache/updater.php
@@ -132,7 +132,14 @@ class Updater {
* @param array $params
*/
static public function touchHook($params) {
- self::writeUpdate($params['path']);
+ $path = $params['path'];
+ list($storage, $internalPath) = self::resolvePath($path);
+ $cache = $storage->getCache();
+ $id = $cache->getId($internalPath);
+ if ($id !== -1) {
+ $cache->update($id, array('etag' => $storage->getETag($internalPath)));
+ }
+ self::writeUpdate($path);
}
/**
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index eadd8a93faf..d60d430d77c 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -222,7 +222,10 @@ class Filesystem {
return false;
}
self::$defaultInstance = new View($root);
- self::$mounts = new Mount\Manager();
+
+ if(!self::$mounts) {
+ self::$mounts = new Mount\Manager();
+ }
//load custom mount config
self::initMountPoints($user);
diff --git a/lib/files/view.php b/lib/files/view.php
index f89b7f66ffd..f35e1e3dc16 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -263,12 +263,13 @@ class View {
if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
if (\OC_FileProxy::runPreProxies('file_put_contents', $absolutePath, $data)
- && Filesystem::isValidPath($path)
+ and Filesystem::isValidPath($path)
+ and ! Filesystem::isFileBlacklisted($path)
) {
$path = $this->getRelativePath($absolutePath);
$exists = $this->file_exists($path);
$run = true;
- if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isIgnoredFile($path)) {
+ if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path)) {
if (!$exists) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
@@ -296,7 +297,7 @@ class View {
list ($count, $result) = \OC_Helper::streamCopy($data, $target);
fclose($target);
fclose($data);
- if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isIgnoredFile($path)) {
+ if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path)) {
if (!$exists) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
@@ -340,6 +341,7 @@ class View {
\OC_FileProxy::runPreProxies('rename', $absolutePath1, $absolutePath2)
and Filesystem::isValidPath($path2)
and Filesystem::isValidPath($path1)
+ and ! Filesystem::isFileBlacklisted($path2)
) {
$path1 = $this->getRelativePath($absolutePath1);
$path2 = $this->getRelativePath($absolutePath2);
@@ -348,7 +350,7 @@ class View {
return false;
}
$run = true;
- if ($this->fakeRoot == Filesystem::getRoot()) {
+ if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path1)) {
\OC_Hook::emit(
Filesystem::CLASSNAME, Filesystem::signal_rename,
array(
@@ -376,7 +378,7 @@ class View {
list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1);
$storage1->unlink($internalPath1);
}
- if ($this->fakeRoot == Filesystem::getRoot()) {
+ if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path1)) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_post_rename,
@@ -404,6 +406,7 @@ class View {
\OC_FileProxy::runPreProxies('copy', $absolutePath1, $absolutePath2)
and Filesystem::isValidPath($path2)
and Filesystem::isValidPath($path1)
+ and ! Filesystem::isFileBlacklisted($path2)
) {
$path1 = $this->getRelativePath($absolutePath1);
$path2 = $this->getRelativePath($absolutePath2);
@@ -606,7 +609,10 @@ class View {
private function basicOperation($operation, $path, $hooks = array(), $extraParam = null) {
$postFix = (substr($path, -1, 1) === '/') ? '/' : '';
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
- if (\OC_FileProxy::runPreProxies($operation, $absolutePath, $extraParam) and Filesystem::isValidPath($path)) {
+ if (\OC_FileProxy::runPreProxies($operation, $absolutePath, $extraParam)
+ and Filesystem::isValidPath($path)
+ and ! Filesystem::isFileBlacklisted($path)
+ ) {
$path = $this->getRelativePath($absolutePath);
if ($path == null) {
return false;
@@ -635,7 +641,7 @@ class View {
private function runHooks($hooks, $path, $post = false) {
$prefix = ($post) ? 'post_' : '';
$run = true;
- if (Filesystem::$loaded and $this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isIgnoredFile($path)) {
+ if (Filesystem::$loaded and $this->fakeRoot == Filesystem::getRoot()) {
foreach ($hooks as $hook) {
if ($hook != 'read') {
\OC_Hook::emit(
diff --git a/lib/l10n/de.php b/lib/l10n/de.php
index cd1bf104d35..13acc1c55b5 100644
--- a/lib/l10n/de.php
+++ b/lib/l10n/de.php
@@ -35,7 +35,7 @@
"Offending command was: \"%s\", name: %s, password: %s" => "Fehlerhafter Befehl war: \"%s\", Name: %s, Passwort: %s",
"MS SQL username and/or password not valid: %s" => "MS SQL Benutzername und/oder Password ungültig: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Dein Web-Server ist noch nicht für Datei-Synchronisation bereit, weil die WebDAV-Schnittstelle vermutlich defekt ist.",
-"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfen Sie die <a href='%s'>Installationsanleitungen</a>.",
+"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfe die <a href='%s'>Installationsanleitungen</a>.",
"seconds ago" => "Gerade eben",
"1 minute ago" => "vor einer Minute",
"%d minutes ago" => "Vor %d Minuten",
diff --git a/lib/l10n/ug.php b/lib/l10n/ug.php
new file mode 100644
index 00000000000..62d91616c1d
--- /dev/null
+++ b/lib/l10n/ug.php
@@ -0,0 +1,19 @@
+<?php $TRANSLATIONS = array(
+"Help" => "ياردەم",
+"Personal" => "شەخسىي",
+"Settings" => "تەڭشەكلەر",
+"Users" => "ئىشلەتكۈچىلەر",
+"Apps" => "ئەپلەر",
+"Authentication error" => "سالاھىيەت دەلىللەش خاتالىقى",
+"Files" => "ھۆججەتلەر",
+"Text" => "قىسقا ئۇچۇر",
+"Images" => "سۈرەتلەر",
+"1 minute ago" => "1 مىنۇت ئىلگىرى",
+"%d minutes ago" => "%d مىنۇت ئىلگىرى",
+"1 hour ago" => "1 سائەت ئىلگىرى",
+"%d hours ago" => "%d سائەت ئىلگىرى",
+"today" => "بۈگۈن",
+"yesterday" => "تۈنۈگۈن",
+"%d days ago" => "%d كۈن ئىلگىرى",
+"%d months ago" => "%d ئاي ئىلگىرى"
+);
diff --git a/lib/filesystem.php b/lib/legacy/filesystem.php
index 34f92b357ca..34f92b357ca 100644
--- a/lib/filesystem.php
+++ b/lib/legacy/filesystem.php
diff --git a/lib/filesystemview.php b/lib/legacy/filesystemview.php
index d6bca62e06a..d6bca62e06a 100644
--- a/lib/filesystemview.php
+++ b/lib/legacy/filesystemview.php
diff --git a/lib/setup.php b/lib/setup.php
index e05db554320..376b71fc03b 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -797,6 +797,7 @@ class OC_Setup {
$content.= "php_value upload_max_filesize 512M\n";//upload limit
$content.= "php_value post_max_size 512M\n";
$content.= "php_value memory_limit 512M\n";
+ $content.= "php_value mbstring.func_overload 0\n";
$content.= "<IfModule env_module>\n";
$content.= " SetEnv htaccessWorking true\n";
$content.= "</IfModule>\n";
diff --git a/lib/templatelayout.php b/lib/templatelayout.php
index d385bb7f19d..7115b8f0306 100644
--- a/lib/templatelayout.php
+++ b/lib/templatelayout.php
@@ -56,7 +56,7 @@ class OC_TemplateLayout extends OC_Template {
$jsfiles = self::findJavascriptFiles(OC_Util::$scripts);
$this->assign('jsfiles', array(), false);
if (OC_Config::getValue('installed', false) && $renderas!='error') {
- $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config'));
+ $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter);
}
if (!empty(OC_Util::$core_scripts)) {
$this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false) . $versionParameter);
diff --git a/lib/util.php b/lib/util.php
index 382c2efce75..f30cdf6a534 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -67,6 +67,7 @@ class OC_Util {
public static function tearDownFS() {
\OC\Files\Filesystem::tearDown();
self::$fsSetup=false;
+ self::$rootMounted=false;
}
/**
@@ -248,7 +249,7 @@ class OC_Util {
'hint'=>'Please ask your server administrator to install the module.');
$web_server_restart=true;
}
- if(!function_exists('imagepng')) {
+ if(!extension_loaded('gd') || !function_exists('gd_info')) {
$errors[]=array('error'=>'PHP module GD is not installed.',
'hint'=>'Please ask your server administrator to install the module.');
$web_server_restart=true;
diff --git a/lib/vobject/compoundproperty.php b/lib/vobject/compoundproperty.php
new file mode 100644
index 00000000000..d702ab802e0
--- /dev/null
+++ b/lib/vobject/compoundproperty.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * ownCloud - VObject Compound Property
+ *
+ * @author Thomas Tanghus
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\VObject;
+
+/**
+ * This class overrides \Sabre\VObject\Property::serialize() to not
+ * double escape commas and semi-colons in compound properties.
+*/
+class CompoundProperty extends \Sabre\VObject\Property\Compound {
+
+ /**
+ * Turns the object back into a serialized blob.
+ *
+ * @return string
+ */
+ public function serialize() {
+
+ $str = $this->name;
+ if ($this->group) {
+ $str = $this->group . '.' . $this->name;
+ }
+
+ foreach($this->parameters as $param) {
+ $str.=';' . $param->serialize();
+ }
+ $src = array(
+ "\n",
+ );
+ $out = array(
+ '\n',
+ );
+ $str.=':' . str_replace($src, $out, $this->value);
+
+ $out = '';
+ while(strlen($str) > 0) {
+ if (strlen($str) > 75) {
+ $out .= mb_strcut($str, 0, 75, 'utf-8') . "\r\n";
+ $str = ' ' . mb_strcut($str, 75, strlen($str), 'utf-8');
+ } else {
+ $out .= $str . "\r\n";
+ $str = '';
+ break;
+ }
+ }
+
+ return $out;
+
+ }
+
+} \ No newline at end of file