DEP PHP Support in CMS5

This commit is contained in:
Sabina Talipova 2022-12-09 16:24:48 +13:00
parent 5d044bd6eb
commit d6b44f2385
4 changed files with 8 additions and 17 deletions

View File

@ -1,3 +0,0 @@
<?php
\SilverStripe\Dev\Deprecation::notification_version('3.0', 'comments');

View File

@ -13,9 +13,9 @@
} }
], ],
"require": { "require": {
"php": "^7.4 || ^8.0", "php": "^8.1",
"silverstripe/framework": "^4.10", "silverstripe/framework": "^5",
"colymba/gridfield-bulk-editing-tools": "^3.0.0-beta4" "colymba/gridfield-bulk-editing-tools": "^4"
}, },
"suggest": { "suggest": {
"ezyang/htmlpurifier": "Standards compliant HTML filter written in PHP", "ezyang/htmlpurifier": "Standards compliant HTML filter written in PHP",
@ -23,8 +23,8 @@
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^9.5", "phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.0", "squizlabs/php_codesniffer": "^3",
"ezyang/htmlpurifier": "^4.14" "ezyang/htmlpurifier": "^4.16"
}, },
"extra": { "extra": {
"expose": [ "expose": [

View File

@ -493,11 +493,7 @@ class CommentingController extends Controller
return $form; return $form;
} }
public function redirectBack(): HTTPResponse
/**
* @return HTTPResponse|false
*/
public function redirectBack()
{ {
// Don't cache the redirect back ever // Don't cache the redirect back ever
HTTPCacheControlMiddleware::singleton()->setMaxAge(0); HTTPCacheControlMiddleware::singleton()->setMaxAge(0);
@ -528,7 +524,5 @@ class CommentingController extends Controller
if (Director::is_site_url($url)) { if (Director::is_site_url($url)) {
return $this->redirect($url); return $this->redirect($url);
} }
return false;
} }
} }

View File

@ -232,7 +232,7 @@ class CommentsExtensionTest extends FunctionalTest
public function testGetCommentRSSLink() public function testGetCommentRSSLink()
{ {
Config::modify()->merge('SilverStripe\\Control\\Director', 'alternate_base_url', 'http://unittesting.local'); Config::modify()->set('SilverStripe\\Control\\Director', 'alternate_base_url', 'http://unittesting.local');
$item = $this->objFromFixture(CommentableItem::class, 'first'); $item = $this->objFromFixture(CommentableItem::class, 'first');
$link = $item->getCommentRSSLink(); $link = $item->getCommentRSSLink();
@ -241,7 +241,7 @@ class CommentsExtensionTest extends FunctionalTest
public function testGetCommentRSSLinkPage() public function testGetCommentRSSLinkPage()
{ {
Config::modify()->merge('SilverStripe\\Control\\Director', 'alternate_base_url', 'http://unittesting.local'); Config::modify()->set('SilverStripe\\Control\\Director', 'alternate_base_url', 'http://unittesting.local');
$item = $this->objFromFixture(CommentableItem::class, 'first'); $item = $this->objFromFixture(CommentableItem::class, 'first');
$page = $item->getCommentRSSLinkPage(); $page = $item->getCommentRSSLinkPage();