I'm looking at the mailsystem_get_classes() function, specifically lines 272 - 296.

It looks like foreach on the line 287 gets included into outer foreach on the line 272

The problem with it is that the internal foreach will execute for each iteration of outer foreach, which just iterates over all available classes and the value of array_unique(mailsystem_get()) is always the same.

Maybe I don't understand something but it seems like a waste of recourses to me.

Patch is also attached.

CommentFileSizeAuthor
mailsystem_get_classes.patch909 bytesgansbrest

Comments

pillarsdotnet’s picture

Title: Strange behavior of mailsystem_get_classes function » Correct the foreach loop nesting error in mailsystem_get_classes() function.
Assigned: Unassigned » pillarsdotnet
Status: Patch (to be ported) » Reviewed & tested by the community

Good catch. Bug only exists in the 6.x branch; time to run a diff against the three branches and look for other divergences.

pillarsdotnet’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.