ElkArte Community

Elk Development => Bug Reports => Topic started by: Joshua Dickerson on October 14, 2015, 04:43:47 pm

Title: Packages.controller.php
Post by: Joshua Dickerson on October 14, 2015, 04:43:47 pm
I am just perusing the code. On line 733 in Packages.controller.php (https://github.com/elkarte/Elkarte/blob/87199557101de23e06b185bab965156acf8d0354/sources/admin/Packages.controller.php#L733) PhpStorm is telling me that isn't a valid use of foreach. It is expecting an array and it is a string. Going up, I see that it is set to a string a couple of times. So, there is something wrong there.
Title: Re: Packages.controller.php
Post by: Spuds on October 14, 2015, 06:16:13 pm
Humm, I'd like to say I'm surprised :P 

If you see what the problem is let me know (or make the PR).  As you know there was some sloppy use of the same variables from form stings to arrays or empty checks with returns before it gets to the other areas etc.  I know this flips out some of the scanner code, but often its right about what its complaining about.  I'd take a look but I'm busy tearing up some other controllers ATM.   Ok not really tearing them up, but more refactoring along the way.
Title: Re: Packages.controller.php
Post by: Joshua Dickerson on October 14, 2015, 07:13:19 pm
Quote from: Spuds – I'd take a look but I'm busy tearing up some other controllers ATM.
Sweet.

I actually screwed up my repo so I'm trying to figure out how to delete the PhpStorm project and refork.
Title: Re: Packages.controller.php
Post by: emanuele on October 18, 2015, 11:30:28 am
Guessing I'd say:
https://github.com/elkarte/Elkarte/blob/87199557101de23e06b185bab965156acf8d0354/sources/admin/Packages.controller.php#L708
and
https://github.com/elkarte/Elkarte/blob/87199557101de23e06b185bab965156acf8d0354/sources/admin/Packages.controller.php#L711