Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-12-04 20:02:47 +0300
committerMorris Jobke <hey@morrisjobke.de>2015-12-04 20:02:47 +0300
commit4548a0aa90cd3b3a0034178609f74bca5b0eccd3 (patch)
treee9313529a661a386a5ad5382083f5bfc08b48eb9 /lib/private/util.php
parente91eba4b5bd856cb1ef81996ace6d16c09f1bb01 (diff)
Remove OC_Util::getUrlContent and replace by proper usage of public interfaces
Diffstat (limited to 'lib/private/util.php')
-rw-r--r--lib/private/util.php23
1 files changed, 5 insertions, 18 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index ac42b96de2d..2038f3bfa2a 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -1237,7 +1237,11 @@ class OC_Util {
// accessing the file via http
$url = OC_Helper::makeURLAbsolute(OC::$WEBROOT . '/data' . $fileName);
- $content = self::getUrlContent($url);
+ try {
+ $content = \OC::$server->getHTTPClientService()->newClient()->get($url)->getBody();
+ } catch (\Exception $e) {
+ $content = false;
+ }
// cleanup
@unlink($testFile);
@@ -1313,23 +1317,6 @@ class OC_Util {
}
/**
- * Get URL content
- * @param string $url Url to get content
- * @throws Exception If the URL does not start with http:// or https://
- * @return string of the response or false on error
- * This function get the content of a page via curl, if curl is enabled.
- * If not, file_get_contents is used.
- * @deprecated Use \OC::$server->getHTTPClientService()->newClient()->get($url);
- */
- public static function getUrlContent($url) {
- try {
- return \OC::$server->getHTTPHelper()->getUrlContent($url);
- } catch (\Exception $e) {
- throw $e;
- }
- }
-
- /**
* Checks whether the server is running on Windows
*
* @return bool true if running on Windows, false otherwise