Make sure there is always a trailing slash for application_url
This commit is contained in:
@@ -18,6 +18,7 @@ Core functionalities moved to plugins:
|
|||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
|
* Make sure there is always a trailing slash for application_url
|
||||||
* Do not show the checkbox "Show default swimlane" when there is no active swimlanes
|
* Do not show the checkbox "Show default swimlane" when there is no active swimlanes
|
||||||
* Append filters instead of replacing value for users and categories dropdowns
|
* Append filters instead of replacing value for users and categories dropdowns
|
||||||
* Do not show empty swimlanes in public view
|
* Do not show empty swimlanes in public view
|
||||||
|
|||||||
@@ -208,6 +208,11 @@ class Config extends Base
|
|||||||
{
|
{
|
||||||
foreach ($values as $option => $value) {
|
foreach ($values as $option => $value) {
|
||||||
|
|
||||||
|
// Be sure that a trailing slash is there for the url
|
||||||
|
if ($option === 'application_url' && ! empty($value) && substr($value, -1) !== '/') {
|
||||||
|
$value .= '/';
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->db->table(self::TABLE)->eq('option', $option)->update(array('value' => $value));
|
$result = $this->db->table(self::TABLE)->eq('option', $option)->update(array('value' => $value));
|
||||||
|
|
||||||
if (! $result) {
|
if (! $result) {
|
||||||
|
|||||||
@@ -7,6 +7,20 @@ use Core\Session;
|
|||||||
|
|
||||||
class ConfigTest extends Base
|
class ConfigTest extends Base
|
||||||
{
|
{
|
||||||
|
public function testSaveApplicationUrl()
|
||||||
|
{
|
||||||
|
$c = new Config($this->container);
|
||||||
|
|
||||||
|
$this->assertTrue($c->save(array('application_url' => 'http://localhost/')));
|
||||||
|
$this->assertEquals('http://localhost/', $c->get('application_url'));
|
||||||
|
|
||||||
|
$this->assertTrue($c->save(array('application_url' => 'http://localhost')));
|
||||||
|
$this->assertEquals('http://localhost/', $c->get('application_url'));
|
||||||
|
|
||||||
|
$this->assertTrue($c->save(array('application_url' => '')));
|
||||||
|
$this->assertEquals('', $c->get('application_url'));
|
||||||
|
}
|
||||||
|
|
||||||
public function testDefaultValues()
|
public function testDefaultValues()
|
||||||
{
|
{
|
||||||
$c = new Config($this->container);
|
$c = new Config($this->container);
|
||||||
@@ -56,11 +70,4 @@ class ConfigTest extends Base
|
|||||||
session_id('');
|
session_id('');
|
||||||
unset($this->container['session']);
|
unset($this->container['session']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSave()
|
|
||||||
{
|
|
||||||
$c = new Config($this->container);
|
|
||||||
$this->assertTrue($c->save(array('application_url' => 'http://localhost/')));
|
|
||||||
$this->assertEquals('http://localhost/', $c->get('application_url'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user