Skip to content

Commit

Permalink
DEP PHP Support in CMS5
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Dec 21, 2022
1 parent 5d044bd commit 8dcd99c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
3 changes: 0 additions & 3 deletions _config.php

This file was deleted.

10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"silverstripe/framework": "^4.10",
"colymba/gridfield-bulk-editing-tools": "^3.0.0-beta4"
"php": "^8.1",
"silverstripe/framework": "^5",
"colymba/gridfield-bulk-editing-tools": "^4"
},
"suggest": {
"ezyang/htmlpurifier": "Standards compliant HTML filter written in PHP",
"silverstripe/cms": "The SilverStripe Content Management System"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.0",
"ezyang/htmlpurifier": "^4.14"
"squizlabs/php_codesniffer": "^3",
"ezyang/htmlpurifier": "^4.16"
},
"extra": {
"expose": [
Expand Down
8 changes: 1 addition & 7 deletions src/Controllers/CommentingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,7 @@ public function CommentsForm()
return $form;
}


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

return false;
}
}
4 changes: 2 additions & 2 deletions tests/CommentsExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function testCanModerateComments()

public function testGetCommentRSSLink()
{
Config::modify()->merge('SilverStripe\\Control\\Director', 'alternate_base_url', 'http://unittesting.local');
Config::modify()->merge('SilverStripe\\Control\\Director', 'alternate_base_url', ['http://unittesting.local']);

$item = $this->objFromFixture(CommentableItem::class, 'first');
$link = $item->getCommentRSSLink();
Expand All @@ -241,7 +241,7 @@ public function testGetCommentRSSLink()

public function testGetCommentRSSLinkPage()
{
Config::modify()->merge('SilverStripe\\Control\\Director', 'alternate_base_url', 'http://unittesting.local');
Config::modify()->merge('SilverStripe\\Control\\Director', 'alternate_base_url', ['http://unittesting.local']);

$item = $this->objFromFixture(CommentableItem::class, 'first');
$page = $item->getCommentRSSLinkPage();
Expand Down

0 comments on commit 8dcd99c

Please sign in to comment.