Support

Admin Tools

#24261 PHP File Change Scanner: Mark All As Safe Not Working

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by user37376 on Thursday, 28 January 2016 16:04 CST

user37376
Issue (Short Version):

-Run File Scanner for first time
-view report
-change filter to show ALL records
-checkbox to toggle all records
-mark as safe
-doesn't mark any as safe when using 'check-all' toggle

If, however, I manual check a few records when ALL are compiled into one table, it works. If I then try to check all again using the 'Check-All' toggle, it doesn't.

I replicated the issue on a localhost install, too. Not a showstopper, but wanted to bring it to your attention.




Details (Long Version):

I ran the php scanner and, like in the video tutorial, clicked on the 'check all' check-box and then 'mark safe' and it worked perfectly.

I did that for a few pages when it hit me—there are probably 5K files I need to mark as safe, so let's change the filter and show more records at a time. I changed to 30 and the 'check all' and 'mark as safe' did, in fact, change the icon on the right to the little check, indicating that the file had been marked as safe.

So I decided to cut through the chase and changed the filter to "All" and it didn't show any records! Unsure why, I changed it back to something lower. like 20-30, and a list compiled. I went back to page 1, thinking maybe it won't show all records because I was toward the end of the list of records. I again changed the filter to all and it compiled a list of all records.

So I clicked the checkbox to mark all records again....scrolled to the end of the lengthy list to ensure all boxed were checked and fired the 'Mark Safe' script. No Change.

With the whole list of records on one page, I went to the very end and selected only ONE (1) record, mark safe, and it worked—the icon on the right showed that the file was marked as safe. So I again used the 'check all' checkbox, mark as safe, nothing.

nicholas
Akeeba Staff
Manager
Actually, this is not a problem. It is a limitation of your server. Moreover, you don't need to do what you tried to do.

When you are selecting checkboxes and submitting a form your server needs to send a POST request. Each checkbox represents a request parameter. At 5,000 files you have a really long request that your server may reject.

Even if that worked, you are asking Joomla! to perform 5,000 database operations, clocking at 80 msec each. It would take 400 seconds –almost 7 minutes– to process that request. This is much higher than your typical PHP execution time limit, not to mention that so many queries would most likely deplete the available PHP memory limit before hitting the time limit.

Therefore, by hitting either of these limits either nothing at all really happens (e.g. hitting the parameter count limit or the memory limit before any database action takes place) or only some of the records are processed (time or memory limit hit while processing the rows).

Note: I have confirmed there is no bug on our side. Selecting 20 rows (all visible with the default settings) and clicking Mark as Safe does work and takes barely a second. When the page reloads the rightmost column changes from a red hollow disk to a checkbox inside a circle. It's not a very obvious change –I hate Joomla!'s default icon set for that– but the change does occur just fine.

But as I said you don't have to mark as safe all 5k+ files on your site. You only need to do that with the files that have a non-zero threat score. On a large site with a healthy number of extensions that would be around 400 files.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user37376
Understood, sir. Thanks.

I suspected a limiter of some sort, which is why I tested on a localhost...wrongly assumed I wouldn't run into any server limitations on the localhost...so when it did it again, I thought I found something. :)

Thanks again for the explanation...makes perfect sense.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!