diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-02-16 01:30:44 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-02-16 01:30:44 +0100 |
commit | 46626915ef6888c958111b259ae6c0d3729b5198 (patch) | |
tree | 2389d96ab36a82c879a777a81b00639f99c40750 /lib/files | |
parent | 425d41aaf93e1cd3a44ddc794414683e8e2c4648 (diff) | |
download | nextcloud-server-46626915ef6888c958111b259ae6c0d3729b5198.tar.gz nextcloud-server-46626915ef6888c958111b259ae6c0d3729b5198.zip |
Use a parser to read custom mount configuration instead of including the php files
Diffstat (limited to 'lib/files')
-rw-r--r-- | lib/files/filesystem.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index f4530868077..89a9ab29212 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -215,9 +215,11 @@ class Filesystem { if ($user == '') { $user = \OC_User::getUser(); } + $parser = new \OC\ArrayParser(); + // Load system mount points if (is_file(\OC::$SERVERROOT . '/config/mount.php')) { - $mountConfig = include 'config/mount.php'; + $mountConfig = $parser->parsePHP(file_get_contents(\OC::$SERVERROOT . '/config/mount.php')); if (isset($mountConfig['global'])) { foreach ($mountConfig['global'] as $mountPoint => $options) { self::mount($options['class'], $options['options'], $mountPoint); @@ -254,7 +256,7 @@ class Filesystem { $root = \OC_User::getHome($user); self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user); if (is_file($root . '/mount.php')) { - $mountConfig = include $root . '/mount.php'; + $mountConfig = $parser->parsePHP(file_get_contents($root . '/mount.php')); if (isset($mountConfig['user'][$user])) { foreach ($mountConfig['user'][$user] as $mountPoint => $options) { self::mount($options['class'], $options['options'], $mountPoint); @@ -613,11 +615,11 @@ class Filesystem { } /** - * Get the owner for a file or folder - * - * @param string $path - * @return string - */ + * Get the owner for a file or folder + * + * @param string $path + * @return string + */ public static function getOwner($path) { return self::$defaultInstance->getOwner($path); } |