mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Overwriting App.fullBaseURL if changed using Router::baseURL()
This commit is contained in:
parent
4bc92b822e
commit
7b746ccb57
2 changed files with 4 additions and 0 deletions
|
@ -920,6 +920,7 @@ class Router {
|
|||
public static function baseURL($base = null) {
|
||||
if ($base !== null) {
|
||||
self::$_baseURL = $base;
|
||||
Configure::write('App.fullBaseURL', $base);
|
||||
}
|
||||
if (empty(self::$_baseURL)) {
|
||||
self::$_baseURL = Configure::read('App.fullBaseURL');
|
||||
|
|
|
@ -50,6 +50,7 @@ class RouterTest extends CakeTestCase {
|
|||
parent::tearDown();
|
||||
CakePlugin::unload();
|
||||
Router::baseURL('');
|
||||
Configure::write('App.fullBaseURL', 'http://localhost');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,8 +74,10 @@ class RouterTest extends CakeTestCase {
|
|||
$this->assertEquals(FULL_BASE_URL, Router::baseUrl());
|
||||
Router::baseURL('http://example.com');
|
||||
$this->assertEquals('http://example.com/', Router::url('/', true));
|
||||
$this->assertEquals('http://example.com', Configure::read('App.fullBaseURL'));
|
||||
Router::baseURL('https://example.com');
|
||||
$this->assertEquals('https://example.com/', Router::url('/', true));
|
||||
$this->assertEquals('https://example.com', Configure::read('App.fullBaseURL'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue