Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-8885

Cleanly handle forum_id/topic_id not found in feed.php

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.7
    • 3.0.6
    • Other
    • None
    • PHP Environment:
      Database:

      The current implementation of feed.php returns a 503 error page from /feed.php?f=<non-existent-id>.

      Relatively quick fix with near zero overhead:

      Find (near top of source):

      $feed->open();

      Replace with:

      if ($feed->open() === false)
      {
              trigger_error('NO_FEED');
      }

      Find (in phpbb_feed::open()):

                      if (!$this->forum_id && !$this->topic_id)
                      {
                              return;
                      }

      Replace with:

                      if (!$this->forum_id && !$this->topic_id)
                      {
                              return true;
                      }

      Find (in phpbb_feed::open()):

                              $global_vars['FEED_MODE'] = $user->lang['FORUM'] . ': ' . $db->sql_fetchfield('forum_name');

      Replace with:

                              $forum_name = $db->sql_fetchfield('forum_name');
                              if ($forum_name === false)
                              {
                                      return false;
                              }
       
                              $global_vars['FEED_MODE'] = $user->lang['FORUM'] . ': ' . $forum_name;

      Find (in phpbb_feed::open()):

                              $global_vars['FEED_MODE'] = $user->lang['TOPIC'] . ': ' . $db->sql_fetchfield('topic_title');
       
                              $db->sql_freeresult($result);
                      }

      Replace with:

                              $topic_title = $db->sql_fetchfield('topic_title');
                              if ($topic_title === false)
                              {
                                      return false;
                              }
       
                              $global_vars['FEED_MODE'] = $user->lang['TOPIC'] . ': ' . $topic_title;
       
                              $db->sql_freeresult($result);
                      }
                      return true;

      Add to the end of 'function open()' in the remaining classes (the 3 classes which extend phpbb_feed):

      return true;

            bantu Andreas Fischer [X] (Inactive)
            paul.j.murphy paul.j.murphy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: