Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9918

$redirect variable set, but not used, in mcp functions

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.0.8
    • Fix Version/s: 3.1.0-a1
    • Labels:
      None
    • Environment:
      Mysql 5.1.36, php 5.3.0, apache 2.2.11

      Description

      In files -> functions:

      ./includes/mcp/mcp_forum.php -> merge_topics
      ./includes/mcp/mcp_topic.php -> split_topic, merge_posts

      in the last lines, the $redirect variable is set, but not used.

      See code here:
      http://www.phpbb.com/community/viewtopic.php?f=71&t=2111376

        Issue Links

          Activity

          Hide
          A_Jelly_Doughnut A_Jelly_Doughnut added a comment -

          My inclination would be to not do anything here, at least for 3.0.x, unless there is some undesired behavior coming from this.

          Show
          A_Jelly_Doughnut A_Jelly_Doughnut added a comment - My inclination would be to not do anything here, at least for 3.0.x, unless there is some undesired behavior coming from this.
          Hide
          marc1706 marc1706 added a comment - - edited

          I think there are 2 solutions to fixing this.

          • Drop the redirect completely: Then we also should remove the redirect from the hidden_fields as it would be obsolete
          • Actually use the redirect value: Then we should change the code to something like this:

           
          	$redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id");
          	$redirect = reapply_sid($redirect);
           
          	if (!$success_msg)
          	{
          		return;
          	}
          	else
          	{
          		meta_refresh(3, $redirect);
          		trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
          	}
          

          Since the current redirect is not index.php, why should we use it in the future as the default redirect?

          Show
          marc1706 marc1706 added a comment - - edited I think there are 2 solutions to fixing this. Drop the redirect completely: Then we also should remove the redirect from the hidden_fields as it would be obsolete Actually use the redirect value: Then we should change the code to something like this:   $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&amp;t=$to_topic_id"); $redirect = reapply_sid($redirect);   if (!$success_msg) { return; } else { meta_refresh(3, $redirect); trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link); } Since the current redirect is not index.php, why should we use it in the future as the default redirect?

            People

            • Assignee:
              Oleg Oleg [X] (Inactive)
              Reporter:
              dokeyfunk dokeyfunk [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development