1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge branch '3.3.x'

This commit is contained in:
Marc Alexander
2025-02-16 17:00:50 +00:00
2 changed files with 55 additions and 0 deletions

View File

@@ -134,6 +134,8 @@ class feed
*/
public function forums()
{
$this->check_enabled();
if (!$this->config['feed_overall_forums'])
{
$this->send_unavailable();
@@ -151,6 +153,8 @@ class feed
*/
public function news()
{
$this->check_enabled();
// Get at least one news forum
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
@@ -176,6 +180,8 @@ class feed
*/
public function topics()
{
$this->check_enabled();
if (!$this->config['feed_topics_new'])
{
$this->send_unavailable();
@@ -193,6 +199,8 @@ class feed
*/
public function topics_new()
{
$this->check_enabled();
return $this->topics();
}
@@ -205,6 +213,8 @@ class feed
*/
public function topics_active()
{
$this->check_enabled();
if (!$this->config['feed_topics_active'])
{
$this->send_unavailable();
@@ -224,6 +234,8 @@ class feed
*/
public function forum($forum_id)
{
$this->check_enabled();
if (!$this->config['feed_forum'])
{
$this->send_unavailable();
@@ -243,6 +255,8 @@ class feed
*/
public function topic($topic_id)
{
$this->check_enabled();
if (!$this->config['feed_topic'])
{
$this->send_unavailable();
@@ -260,6 +274,8 @@ class feed
*/
public function overall()
{
$this->check_enabled();
if (!$this->config['feed_overall'])
{
$this->send_unavailable();
@@ -407,6 +423,22 @@ class feed
return $response;
}
/**
* Check if feeds are enabled in the configuration.
*
* @throws http_exception If feeds are disabled.
*
* @return void
*/
protected function check_enabled()
{
// Feeds are disabled, no need to continue
if (!$this->config['feed_enable'])
{
throw new http_exception(404, 'NO_FEED_ENABLED');
}
}
/**
* Throw and exception saying that the feed isn't available
*