mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
Merge tag '3.5.3' into 3.5
Release 3.5.3
This commit is contained in:
commit
7ac2be0802
@ -12,7 +12,7 @@ addons:
|
||||
|
||||
env:
|
||||
global:
|
||||
- CORE_RELEASE=3.4
|
||||
- CORE_RELEASE=3
|
||||
|
||||
matrix:
|
||||
include:
|
||||
|
@ -323,22 +323,5 @@ class ErrorPage extends Page {
|
||||
* @package cms
|
||||
*/
|
||||
class ErrorPage_Controller extends Page_Controller {
|
||||
|
||||
/**
|
||||
* Overload the provided {@link Controller::handleRequest()} to append the
|
||||
* correct status code post request since otherwise permission related error
|
||||
* pages such as 401 and 403 pages won't be rendered due to
|
||||
* {@link SS_HTTPResponse::isFinished() ignoring the response body.
|
||||
*
|
||||
* @param SS_HTTPRequest $request
|
||||
* @param DataModel $model
|
||||
* @return SS_HTTPResponse
|
||||
*/
|
||||
public function handleRequest(SS_HTTPRequest $request, DataModel $model = NULL) {
|
||||
$body = parent::handleRequest($request, $model);
|
||||
$this->getResponse()->setStatusCode($this->ErrorCode);
|
||||
|
||||
return $this->getResponse();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2177,7 +2177,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
$labels['ParentID'] = _t('SiteTree.PARENTID', "Parent page");
|
||||
$labels['ShowInMenus'] =_t('SiteTree.SHOWINMENUS', "Show in menus?");
|
||||
$labels['ShowInSearch'] = _t('SiteTree.SHOWINSEARCH', "Show in search?");
|
||||
$labels['ProvideComments'] = _t('SiteTree.ALLOWCOMMENTS', "Allow comments on this page?");
|
||||
$labels['ViewerGroups'] = _t('SiteTree.VIEWERGROUPS', "Viewer Groups");
|
||||
$labels['EditorGroups'] = _t('SiteTree.EDITORGROUPS', "Editor Groups");
|
||||
$labels['URLSegment'] = _t('SiteTree.URLSegment', 'URL Segment', 'URL for this page');
|
||||
|
@ -24,7 +24,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"3.x-dev": "3.5.x-dev"
|
||||
"3.x-dev": "3.6.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -64,13 +64,19 @@ class ErrorPageTest extends FunctionalTest {
|
||||
public function testBehaviourOf403() {
|
||||
$page = $this->objFromFixture('ErrorPage', '403');
|
||||
$page->publish('Stage', 'Live');
|
||||
|
||||
$response = $this->get($page->RelativeLink());
|
||||
|
||||
$this->assertEquals($response->getStatusCode(), '403');
|
||||
$this->assertNotNull($response->getBody(), 'We have body text from the error page');
|
||||
|
||||
try {
|
||||
$controller = singleton('ContentController');
|
||||
$controller->httpError(403);
|
||||
$this->fail('Expected exception to be thrown');
|
||||
}
|
||||
catch(SS_HTTPResponse_Exception $e) {
|
||||
$response = $e->getResponse();
|
||||
$this->assertEquals($response->getStatusCode(), '403');
|
||||
$this->assertNotNull($response->getBody(), 'We have body text from the error page');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function testSecurityError() {
|
||||
// Generate 404 page
|
||||
$page = $this->objFromFixture('ErrorPage', '404');
|
||||
|
Loading…
x
Reference in New Issue
Block a user