summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-11-18 21:42:56 +0100
committerGitHub <noreply@github.com>2016-11-18 21:42:56 +0100
commit8ec2e34576e84b256ee671f805a319ff27f3f944 (patch)
tree2166e9fdd683f8e9b82cea7419b679323fad44a6 /lib/private
parent4458e294bc6530ef226ead91bd6cb9f753697f32 (diff)
parent1614b310ef0e4871dc5f21630e887010e0fb22bc (diff)
downloadnextcloud-server-8ec2e34576e84b256ee671f805a319ff27f3f944.tar.gz
nextcloud-server-8ec2e34576e84b256ee671f805a319ff27f3f944.zip
Merge pull request #1602 from nextcloud/ignore-mod-env
Add system config htaccess.IgnoreFrontController for prettyURLs w/o mod_env
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Route/Router.php3
-rw-r--r--lib/private/Template/JSConfigHelper.php2
-rw-r--r--lib/private/URLGenerator.php3
-rw-r--r--lib/private/legacy/util.php7
4 files changed, 9 insertions, 6 deletions
diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php
index 59f403d66e8..fd15400dad4 100644
--- a/lib/private/Route/Router.php
+++ b/lib/private/Route/Router.php
@@ -4,6 +4,7 @@
*
* @author Bart Visscher <bartv@thisnet.nl>
* @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @author Felix Anand Epp <work@felixepp.de>
* @author Joas Schilling <coding@schilljs.com>
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
* @author Lukas Reschke <lukas@statuscode.ch>
@@ -71,7 +72,7 @@ class Router implements IRouter {
public function __construct(ILogger $logger) {
$this->logger = $logger;
$baseUrl = \OC::$WEBROOT;
- if(!(getenv('front_controller_active') === 'true')) {
+ if(!(\OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) {
$baseUrl = \OC::$server->getURLGenerator()->linkTo('', 'index.php');
}
if (!\OC::$CLI) {
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php
index eceaed0c380..a724c124de0 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -207,7 +207,7 @@ class JSConfigHelper {
'versionstring' => \OC_Util::getVersionString(),
'enable_avatars' => $this->config->getSystemValue('enable_avatars', true) === true,
'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null),
- 'modRewriteWorking' => (getenv('front_controller_active') === 'true'),
+ 'modRewriteWorking' => (\OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'),
]),
"oc_appconfig" => json_encode([
'core' => [
diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php
index bdf7bdafae3..f041487ea88 100644
--- a/lib/private/URLGenerator.php
+++ b/lib/private/URLGenerator.php
@@ -3,6 +3,7 @@
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Bart Visscher <bartv@thisnet.nl>
+ * @author Felix Anand Epp <work@felixepp.de>
* @author Joas Schilling <coding@schilljs.com>
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
* @author Lukas Reschke <lukas@statuscode.ch>
@@ -93,7 +94,7 @@ class URLGenerator implements IURLGenerator {
* Returns a url to the given app and file.
*/
public function linkTo( $app, $file, $args = array() ) {
- $frontControllerActive = (getenv('front_controller_active') === 'true');
+ $frontControllerActive = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true');
if( $app != '' ) {
$app_path = \OC_App::getAppPath($app);
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index 3bd5b5586ab..cc665b5ec65 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -14,6 +14,7 @@
* @author Christoph Wurst <christoph@owncloud.com>
* @author Clark Tomlinson <fallen013@gmail.com>
* @author cmeh <cmeh@users.noreply.github.com>
+ * @author Felix Anand Epp <work@felixepp.de>
* @author Florin Peter <github@florin-peter.de>
* @author Frank Karlitschek <frank@karlitschek.de>
* @author Georg Ehrke <georg@owncloud.com>
@@ -524,7 +525,7 @@ class OC_Util {
*
* @param string $application application id
* @param string $languageCode language code, defaults to the current language
- * @param bool $prepend prepend the Script to the beginning of the list
+ * @param bool $prepend prepend the Script to the beginning of the list
*/
public static function addTranslations($application, $languageCode = null, $prepend = false) {
if (is_null($languageCode)) {
@@ -569,7 +570,7 @@ class OC_Util {
*
* @param string $application application id
* @param bool $prepend prepend the file to the beginning of the list
- * @param string $path
+ * @param string $path
* @param string $type (script or style)
* @return void
*/
@@ -1076,7 +1077,7 @@ class OC_Util {
}
}
- if(getenv('front_controller_active') === 'true') {
+ if(\OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') {
$location = $urlGenerator->getAbsoluteURL('/apps/' . $appId . '/');
} else {
$location = $urlGenerator->getAbsoluteURL('/index.php/apps/' . $appId . '/');