aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-12-05 19:57:06 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-12-11 00:09:55 +0100
commit9ea205dc3dd27f6e2506a4867e29b12180251620 (patch)
treee063d01f8b4be75e3bf823928dbd53d06b51f2f9 /lib/private
parentd84a1f6f3ae380d42dbd2970d6b3bfedd5e01200 (diff)
downloadnextcloud-server-9ea205dc3dd27f6e2506a4867e29b12180251620.tar.gz
nextcloud-server-9ea205dc3dd27f6e2506a4867e29b12180251620.zip
Check if open_basedir is set
The file:// protocol does not work with curl when an open_basedir is set. This fixes https://github.com/owncloud/core/issues/12016
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/largefilehelper.php2
-rw-r--r--lib/private/server.php6
2 files changed, 4 insertions, 4 deletions
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 c0606fc4fe6..4107a0eeec8 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -286,7 +286,7 @@ class Server extends SimpleContainer implements IServerContainer {
return new \OC\Files\Config\MountProviderCollection($loader);
});
$this->registerService('IniWrapper', function ($c) {
- return new IniGetWrapper();
+ return new IniGetWrapper();
});
}
@@ -730,9 +730,9 @@ class Server extends SimpleContainer implements IServerContainer {
/**
* Get the IniWrapper
*
- * @return \bantu\IniGetWrapper\IniGetWrapper
+ * @return IniGetWrapper
*/
public function getIniWrapper() {
- return $this->query('IniWrapper');
+ return $this->query('IniWrapper');
}
}