hsdn / lg

PHP Version of BGP Looking Glass script, based on the Perl sources: https://github.com/Cougar/lg
Other
41 stars 33 forks source link

Fix for PHP 7 compatibility #5

Closed Pinkbyte closed 6 years ago

Pinkbyte commented 7 years ago

Problem: with PHP 7 showing some BGP info and routes does not work with such message in error.log:

[client 10.0.0.213:51788] AH01071: Got error 'PHP message: PHP Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /var/www/lg/htdocs/index.php on line 914\n'

Proposed fix:

Replace call of preg_replace with unsupported modifier with preg_replace_callback in Mikrotik section

Unfortunately i can not test similar fixes for other router types(because i did not have them), so i did work only for Mikrotik related stuff

justkeepquiet commented 7 years ago

Hello.

All preg_replace calls with the /e modifier must be replaced with preg_replace_callback for good work on PHP 7. This is a lot of lines of code in the script.

We will not do this work until we need to migrate to PHP 7.

justkeepquiet commented 7 years ago

You can do this work if you have time. After that it will be possible to merge the branches. Thank you!

justkeepquiet commented 6 years ago

Solved by commit https://github.com/hsdn/lg/commit/518a793e04986f1a2ead72b1dfe9476396675194.