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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0.9-RC1
    • 3.0.8
    • Sessions
    • None

      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;
      				}

            nickvergessen Joas Schilling
            nickvergessen Joas Schilling
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: