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

Incorrect message handling when issuing warning for a specific post

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.2
    • 3.0.1
    • None
    • PHP Environment:
      Database:

      It's in includes/mcp/mcp_warn.php. There's the code

      		if ($warning && $action == 'add_warning')
      		{
      			if (check_form_key('mcp_warn'))
      			{
      				add_warning($user_row, $warning, $notify, $post_id);
      				$msg = $user->lang['USER_WARNING_ADDED'];
      			}
      			else
      			{
      				$msg = $user->lang['FORM_INVALID'];
      			}
      			$redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id");
      			meta_refresh(2, $redirect);
      			trigger_error($user->lang['USER_WARNING_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
      		}

      As we can see, the message triggered after submitting a form doesn't depend on real message ($msg) value and is always equal to $user->lang['USER_WARNING_ADDED']. Seems it should be

      trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));

            Acyd Burn Meik Sievertsen [X] (Inactive)
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: