diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-02-11 01:10:03 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-12-01 16:46:07 +0100 |
commit | 2515cb17be18da4aee32167259ee75fdc7a5a56b (patch) | |
tree | 38635a8d2181478f8200c5bb7dea96b26c184822 /tests | |
parent | 74e8c25a5b48eb4b675de262ced1702dec4307f4 (diff) | |
download | nextcloud-server-2515cb17be18da4aee32167259ee75fdc7a5a56b.tar.gz nextcloud-server-2515cb17be18da4aee32167259ee75fdc7a5a56b.zip |
Support pretty URLs
This changeset allows ownCloud to run with pretty URLs, they will be used if mod_rewrite and mod_env are available. This means basically that the `index.php` in the URL is not shown to the user anymore.
Also the not deprecated functions to generate URLs have been modified to support this behaviour, old functions such as `filePath` will still behave as before for compatibility reasons.
Examples:
http://localhost/owncloud/index.php/s/AIDyKbxiRZWAAjP => http://localhost/owncloud/s/AIDyKbxiRZWAAjP
http://localhost/owncloud/index.php/apps/files/ => http://localhost/owncloud/apps/files/
Due to the way our CSS and JS is structured the .htaccess uses some hacks for the final result but could be worse... And I was just annoyed by all that users crying for the removal of `index.php` ;-)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/util.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/lib/util.php b/tests/lib/util.php index 608c5f0c501..032ede74a81 100644 --- a/tests/lib/util.php +++ b/tests/lib/util.php @@ -338,6 +338,26 @@ class Test_Util extends \Test\TestCase { ); } + public function testGetDefaultPageUrlWithRedirectUrlWithoutFrontController() { + putenv('front_controller_active=false'); + + $_REQUEST['redirect_url'] = 'myRedirectUrl.com'; + $this->assertSame('http://localhost'.\OC::$WEBROOT.'/myRedirectUrl.com', OC_Util::getDefaultPageUrl()); + } + + public function testGetDefaultPageUrlWithRedirectUrlRedirectBypassWithoutFrontController() { + putenv('front_controller_active=false'); + + $_REQUEST['redirect_url'] = 'myRedirectUrl.com@foo.com:a'; + $this->assertSame('http://localhost'.\OC::$WEBROOT.'/index.php/apps/files/', OC_Util::getDefaultPageUrl()); + } + + public function testGetDefaultPageUrlWithRedirectUrlRedirectBypassWithFrontController() { + putenv('front_controller_active=true'); + $_REQUEST['redirect_url'] = 'myRedirectUrl.com@foo.com:a'; + $this->assertSame('http://localhost'.\OC::$WEBROOT.'/apps/files/', OC_Util::getDefaultPageUrl()); + } + /** * Test needUpgrade() when the core version is increased */ |