Integrity problem after modifying some files

Hi everyone!

My question is easy, I have modified two NextCloud files because in the Security Notices section I had two problems:

  1. HTTP header is not set for at least “15552000” seconds. To do this, by modifying the htacceso file, I have been able to make the error disappear.
  2. It showed me the error: “message”: "ZipArchive :: open (): Using empty file as ZipArchive is deprecated at /var/www/html/lib/private/Archive/ZIP.php# To solve it I have modified the file ZIP.php by modifying the ZipArchive :: CREATE line to ZipArchive :: OVERWRITE, and that error was removed.

But now they tell me that those two files do not pass the integrity check (because I have modified them).

Is there a way for that signature error not to appear? If I replace the files with the original ones from nextcloud it will give me the same errors again …

Results
=======
- core
	- INVALID_HASH
		- .htaccess
		- lib/private/Archive/ZIP.php

Raw output
==========
Array
(
    [core] => Array
        (
            [INVALID_HASH] => Array
                (
                    [.htaccess] => Array
                        (
                            [expected] => 1b7e58df33e22722670a77dd1f19eb863f277d5ac79d33d5f5d6e8b7a5977223cb78ba58132f991248b13d13eac744649c2d8a72cf5ec711643cf8c7aec5c456
                            [current] => a050314fb0a3e71337fe7d3a0482614167aa515d125bf717e30d6c0ef689d57a835e48f62ed666fcfedf0ba35db08a418db7871f76a2af93eaf425f6d7ac5d64
                        )

                    [lib/private/Archive/ZIP.php] => Array
                        (
                            [expected] => 636418a76226b115808ed8ea78c1fedd4f703d07f60c2754264d85392932278b34e41be3dd85553592b3410f3daf01e098bd6ceec7f6466e1bd1bf6b89ec5df8
                            [current] => 522a4541f0fb546c4b0d674d0406ee2eafb19bf7162211facbcc65f72fb73e6603ec1b08f22e70243b2ae64a90077846dfa4874af00dd466c3eb2a6e6a830a82
                        )

                )

        )

)

Thanks!

You should not modify the modules php-files but the php.ini, config.php and the webserver config file only, if needed.

1 Like

Hello!

Okay, the problem now is that the .htaccess file no longer has the same hash. How could I solve this?
Putting the original files?

Thanks.

If you do not know anymore, what changes you did in the .htaccess, you can download the Nextcloud server package as zip file and extract the .htaccess. (take care of the Nextcloud version)

If you exactly know the changes you did, undo them and take care, that the additional blanks and line feeds need to be undone, too.

1 Like

I tried to leave the htaccess as I had it and it gave 404 error in nextcloud, I put the original one back.
Then I put the file called original zip and it seems that it disappeared but it gave another error.
As I did not have much data I have learned the lesson of not touching nextcloud files and I have done a clean installation from 0.

Thanks.