[Pkg-owncloud-commits] [owncloud] 09/34: Revert "Set overwrite.cli.url configs on setup"

David Prévot taffit at moszumanska.debian.org
Fri Oct 17 01:32:15 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit c38454a5b243a1c135250326d76867284aec6328
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Mon Oct 13 17:30:25 2014 +0200

    Revert "Set overwrite.cli.url configs on setup"
    
    This reverts commit 48a1e69f5e803d61edcd7d083fd8e794f5bf194d.
    
    This was backported too quickly.
---
 config/config.sample.php     |  7 -------
 lib/private/setup.php        |  2 +-
 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 d86d46a..ffbcbea 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 2ad569c..2747922 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 1844925..af5d977 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;
 	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list