diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-12-11 14:15:24 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-12-11 14:15:24 +0100 |
commit | 8fd90e04b62c10a48ac15a3a52f7cd6b4040359d (patch) | |
tree | 853e78bf91a327d7062c1dd94b6e1eedaeec47a9 /lib | |
parent | 17d68e0638e65bdd5b59a68ffe366444723f5e8d (diff) | |
parent | 9ea205dc3dd27f6e2506a4867e29b12180251620 (diff) | |
download | nextcloud-server-8fd90e04b62c10a48ac15a3a52f7cd6b4040359d.tar.gz nextcloud-server-8fd90e04b62c10a48ac15a3a52f7cd6b4040359d.zip |
Merge pull request #12781 from owncloud/jenkins-curl-open-basedir
[Jenkins only] curl open basedir
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 2 | ||||
-rw-r--r-- | lib/private/largefilehelper.php | 2 | ||||
-rw-r--r-- | lib/private/server.php | 14 | ||||
-rw-r--r-- | lib/public/iservercontainer.php | 7 |
4 files changed, 22 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php index af2474c7d76..f2ff3bb4849 100644 --- a/lib/base.php +++ b/lib/base.php @@ -717,7 +717,7 @@ class OC { // Check if ownCloud is installed or in maintenance (update) mode if (!$systemConfig->getValue('installed', false)) { \OC::$server->getSession()->clear(); - $controller = new OC\Core\Setup\Controller(\OC::$server->getConfig()); + $controller = new OC\Core\Setup\Controller(\OC::$server->getConfig(), \OC::$server->getIniWrapper(), \OC::$server->getL10N('core'), new \OC_Defaults()); $controller->run($_POST); exit(); } diff --git a/lib/private/largefilehelper.php b/lib/private/largefilehelper.php index 750ba1d23de..b6a8c536e9b 100644 --- a/lib/private/largefilehelper.php +++ b/lib/private/largefilehelper.php @@ -100,7 +100,7 @@ class LargeFileHelper { * null on failure. */ public function getFileSizeViaCurl($filename) { - if (function_exists('curl_init')) { + if (function_exists('curl_init') && \OC::$server->getIniWrapper()->getString('open_basedir') === '') { $fencoded = rawurlencode($filename); $ch = curl_init("file://$fencoded"); curl_setopt($ch, CURLOPT_NOBODY, true); diff --git a/lib/private/server.php b/lib/private/server.php index e0105506970..4107a0eeec8 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -2,6 +2,7 @@ namespace OC; +use bantu\IniGetWrapper\IniGetWrapper; use OC\AppFramework\Http\Request; use OC\AppFramework\Db\Db; use OC\AppFramework\Utility\SimpleContainer; @@ -11,7 +12,6 @@ use OC\Diagnostics\EventLogger; use OC\Diagnostics\QueryLogger; use OC\Files\Config\StorageManager; use OC\Security\CertificateManager; -use OC\DB\ConnectionWrapper; use OC\Files\Node\Root; use OC\Files\View; use OC\Security\Crypto; @@ -285,6 +285,9 @@ class Server extends SimpleContainer implements IServerContainer { $loader = \OC\Files\Filesystem::getLoader(); return new \OC\Files\Config\MountProviderCollection($loader); }); + $this->registerService('IniWrapper', function ($c) { + return new IniGetWrapper(); + }); } /** @@ -723,4 +726,13 @@ class Server extends SimpleContainer implements IServerContainer { function getMountProviderCollection(){ return $this->query('MountConfigManager'); } + + /** + * Get the IniWrapper + * + * @return IniGetWrapper + */ + public function getIniWrapper() { + return $this->query('IniWrapper'); + } } diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php index 657c9be423b..193e2fdf105 100644 --- a/lib/public/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -310,4 +310,11 @@ interface IServerContainer { * @return \OCP\Files\Config\IMountProviderCollection */ function getMountProviderCollection(); + + /** + * Get the IniWrapper + * + * @return \bantu\IniGetWrapper\IniGetWrapper + */ + function getIniWrapper(); } |