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

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

XMLWordPrintable

      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']], '%');
      

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

              Created:
              Updated:
              Resolved: