mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Include baseURL with relative setGetVar() links (#8834)
* Return baseURL with setGetVar * Adjust testSetGetVar tests for base url
This commit is contained in:
parent
2c971eea83
commit
66c372ce28
@ -268,7 +268,7 @@ class HTTP
|
|||||||
$newUri = $scheme . '://' . $user . $host . $port . $path . $params . $fragment;
|
$newUri = $scheme . '://' . $user . $host . $port . $path . $params . $fragment;
|
||||||
|
|
||||||
if ($isRelative) {
|
if ($isRelative) {
|
||||||
return Director::makeRelative($newUri);
|
return Director::baseURL() . Director::makeRelative($newUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newUri;
|
return $newUri;
|
||||||
|
@ -246,13 +246,13 @@ class HTTPTest extends FunctionalTest
|
|||||||
}, 'relative/url/');
|
}, 'relative/url/');
|
||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'relative/url?foo=bar',
|
'/relative/url?foo=bar',
|
||||||
HTTP::setGetVar('foo', 'bar', 'relative/url'),
|
HTTP::setGetVar('foo', 'bar', 'relative/url'),
|
||||||
'Relative URL without existing query params'
|
'Relative URL without existing query params'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'relative/url?baz=buz&foo=bar',
|
'/relative/url?baz=buz&foo=bar',
|
||||||
HTTP::setGetVar('foo', 'bar', '/relative/url?baz=buz'),
|
HTTP::setGetVar('foo', 'bar', '/relative/url?baz=buz'),
|
||||||
'Relative URL with existing query params, and new added key'
|
'Relative URL with existing query params, and new added key'
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user