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

Ext Catalog is using variables in loops incorrectly

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 4.0.0-a1, 4.0.0-a2, 4.0.0-b1
    • Extensions
    • None

      In a foreach loop in the composer extension installer, where it processes  $compatible_packages, the {{$versions }}array contains versions from all iterations, not just the current package. So it needlessly loops through every single possible extension and version, while processing each extension.

      The problem is a variable naming conflict where  $versions is being used both:

      1. As a local variable in the inner loops when collecting packages from repositories
      1. As the loop variable in the final foreach loop that processes $compatible_packages
         

      This causes the {{$versions }}variable in the final loop to potentially contain accumulated data from previous iterations rather than just the versions for the current package.

       

      So the loop variables should be renamed.

            Unassigned Unassigned
            MattF Matt Friedman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: