Support

Admin Tools

#26746 PHP File Change Scanner: "Diff to the previous version" is always empty.

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 HueNa on Thursday, 15 December 2016 20:38 CST

HueNa
 Hello,

I noticed that the PHP File Change Scanner doesn't show the diff in the Report.
The value of the "diff" field of the "#__admintools_scanalerts" table is always "###MODIFIED FILE###" for the modified path.

I confirmed that "Calculate diffs when scanning" is set to YES.
Please let me know how to see the diff of the modified files with the PHP File Change Scanner.

nicholas
Akeeba Staff
Manager
This is only possible when the only changes in the file are in whitespace and/or line endings, e.g. different number of spaces, spaces instead of tabs or change in the line ending (e.g. UNIX instead of Windows). These are all changes that the diff algorithm omits, therefore reporting no changed lines. However, the file scanner does NOT trust the diff engine to detect when a file has changed. It looks at the file size, file modification date and the MD5 and SHA-1 checksums. If any of these four factors has changed the file is reported changed.

What that means practically? If you replace on file with another one that's identical except for tabs, spaces and/or line endings the file will be reported as changed but the diff will be empty.

If this is not the case and you get this result for all files then something is broken in your installation. In this case please install Admin Tools twice in a row, without uninstalling it before or in between. This should replace any obsolete files in the scanning engine.

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!

HueNa
Hello ,
Thank you for your support.

Yes, this is not the case.
A file is modified on a string constant, which doesn't contain any tabs and spaces.

I installed the Admin Tools twice in a row, as you mentioned,
and now it shows the diff as expected!

Thank you very much.

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!