diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-10-13 17:30:25 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-10-13 17:30:53 +0200 |
commit | c38454a5b243a1c135250326d76867284aec6328 (patch) | |
tree | ce7ed8339b9253f46c229bb854487c1941016a41 | |
parent | e4fa642e545b4a98bc52513213ec92efdff20331 (diff) | |
download | nextcloud-server-c38454a5b243a1c135250326d76867284aec6328.tar.gz nextcloud-server-c38454a5b243a1c135250326d76867284aec6328.zip |
Revert "Set overwrite.cli.url configs on setup"
This reverts commit 48a1e69f5e803d61edcd7d083fd8e794f5bf194d.
This was backported too quickly.
-rwxr-xr-x | config/config.sample.php | 7 | ||||
-rw-r--r-- | lib/private/setup.php | 2 | ||||
-rw-r--r-- | lib/private/urlgenerator.php | 13 |
3 files changed, 7 insertions, 15 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index d86d46a698d..ffbcbeaf3bf 100755 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -330,13 +330,6 @@ $CONFIG = array( 'overwritecondaddr' => '', /** - * Use this configuration parameter to specify the base url for any urls which are - * generated within ownCloud using any kind of command line tools (cron or occ). - * The value should contain the full base URL: ``https://www.example.com/owncloud`` - */ -'overwrite.cli.url' => '', - -/** * The URL of your proxy server, for example ``proxy.example.com:8081``. */ 'proxy' => '', diff --git a/lib/private/setup.php b/lib/private/setup.php index 2ad569cb483..274792297d9 100644 --- a/lib/private/setup.php +++ b/lib/private/setup.php @@ -82,7 +82,7 @@ class OC_Setup { //write the config file OC_Config::setValue('trusted_domains', $trustedDomains); OC_Config::setValue('datadirectory', $datadir); - OC_Config::setValue('overwrite.cli.url', \OC_Request::serverProtocol() . '://' . \OC_Request::serverHost() . OC::$WEBROOT); + OC_Config::setValue('overwritewebroot', OC::$WEBROOT); OC_Config::setValue('dbtype', $dbtype); OC_Config::setValue('version', implode('.', OC_Util::getVersion())); try { diff --git a/lib/private/urlgenerator.php b/lib/private/urlgenerator.php index 1844925ccb3..af5d977eeab 100644 --- a/lib/private/urlgenerator.php +++ b/lib/private/urlgenerator.php @@ -147,14 +147,13 @@ class URLGenerator implements IURLGenerator { * @return string the absolute version of the url */ public function getAbsoluteURL($url) { - $url = ($url[0] !== '/') ? '/' . $url : $url; - - if (\OC::$CLI) { - return $this->config->getSystemValue('overwrite.cli.url') . $url; - } + $separator = $url[0] === '/' ? '' : '/'; // The ownCloud web root can already be prepended. - $webRoot = (strpos($url, \OC::$WEBROOT) === 0) ? '' : \OC::$WEBROOT; - return \OC_Request::serverProtocol() . '://' . \OC_Request::serverHost() . $webRoot . $url; + $webRoot = substr($url, 0, strlen(\OC::$WEBROOT)) === \OC::$WEBROOT + ? '' + : \OC::$WEBROOT; + + return \OC_Request::serverProtocol() . '://' . \OC_Request::serverHost(). $webRoot . $separator . $url; } } |