Merge branch '3.2' into 3.3

This commit is contained in:
Daniel Hensby 2016-06-13 14:34:12 +01:00
commit 19047d1577
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
2 changed files with 8 additions and 3 deletions

View File

@ -12,13 +12,18 @@ class OldPageRedirector extends Extension {
public function onBeforeHTTPError404($request) {
// We need to get the URL ourselves because $request->allParams() only has a max of 4 params
$params = preg_split('|/+|', $request->getURL());
$cleanURL = trim(Director::makeRelative($request->getURL(false), '/'));
$getvars = $request->getVars();
unset($getvars['url']);
$page = self::find_old_page($params);
$cleanPage = trim(Director::makeRelative($page), '/');
if (!$cleanPage) {
$cleanPage = Director::makeRelative(RootURLController::get_homepage_link());
}
if ($page) {
if ($page && $cleanPage != $cleanURL) {
$res = new SS_HTTPResponse();
$res->redirect(
Controller::join_links(

View File

@ -947,9 +947,9 @@ class SiteTreeTest extends SapphireTest {
$valid = $classB->doValidate();
$this->assertFalse($valid->valid(), "Doesnt allow child on parents disallowing all children");
$classB->ParentID = $classC->ID;
$classB->ParentID = $classCext->ID;
$valid = $classB->doValidate();
$this->assertFalse($valid->valid(), "Doesnt allow child on parents disallowing all children");
$this->assertTrue($valid->valid(), "Extensions of allowed classes are incorrectly reported as invalid");
$classCext->ParentID = $classD->ID;
$valid = $classCext->doValidate();