Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.6k stars 397 forks source link

Function file_get_contents in file link.php #5782

Closed gadzet21 closed 2 days ago

gadzet21 commented 3 days ago

Hi, Changing the include_once function to file_get_contents resulted in the php code not being processed. This change occurred in the commit below - in Cacti version 1.2.26 (same in version 1.2.27) https://github.com/Cacti/cacti/commit/a2af4f880497f339c20ce0671067e098c85f710b

A simple example on the php-example.html file in the /include/content directory Instead of parsing the php code, it shows it as a comment: image

Debian 9 and 12, Apache 2.4, PHP 7.0 and 8.2

Regards, Jacek

TheWitness commented 2 days ago

Yea, it was a part of the hardening project, but the bug was for files outside of the 'content' folder. So, I'm okay with this.

TheWitness commented 2 days ago

Resolved now. Thanks for reporting.