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

$user->lang() is not handling arguments as per documentation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.8
    • Fix Version/s: 3.0.9-RC1
    • Component/s: Sessions
    • Labels:
      None

      Description

      With the $user->lang() you can directly sprintf() into a language string.
      This is useful, when you need different language-strings for different input (1 post, 3 posts, etc.)

      Now the code says:

      		// We now get the first number passed and will select the key based upon this number

      but this is not correct. Currently it uses the last int, as it does not exit the loop of arguments.
      this can be easily fixed by adding a break; after

      				foreach ($numbers as $num)
      				{
      					if ($num > $args[$i])
      					{
      						break;
      					}
       
      					$key_found = $num;
      				}

        Attachments

          Activity

            People

            Assignee:
            nickvergessen Joas Schilling [X] (Inactive)
            Reporter:
            nickvergessen Joas Schilling [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: