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

The logs message aren't filled correctly when some values are missing.

    Details

      Description

      In \phpbb\log\log::get_logs, lines 516 to 531 we have that :

      					// Check if there are more occurrences of % than
      					// arguments, if there are we fill out the arguments
      					// array. It doesn't matter if we add more arguments than
      					// placeholders.
      					$num_args = 0;
      					if (!is_array($this->user->lang[$row['log_operation']]))
      					{
      						$num_args = substr_count($log[$i]['action'], '%');
      					}
      					else
      					{
      						foreach ($this->user->lang[$row['log_operation']] as $case => $plural_string)
      						{
      							$num_args = max($num_args, substr_count($plural_string, '%'));
      						}
      					}
      

      The line 523 is wrong, we are counting the number of placeholders in the key instead of his value. So this line should be:

      $num_args = substr_count($this->user->lang[$row['log_operation']], '%');
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: