librespeed / speedtest

Self-hosted Speed Test for HTML5 and more. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more
https://librespeed.org
GNU Lesser General Public License v3.0
12.27k stars 2.21k forks source link

fix ipinfo-db with old versions of PHP #651

Closed IRainman closed 3 months ago

IRainman commented 3 months ago

This patch is returns the ability to do online check for IP location on older PHP versions.

sstidl commented 3 months ago

@IRainman If I read it correctly your patch disables the functionality completely? what is the problem with old versions of php? and how old is old?

IRainman commented 3 months ago

@IRainman If I read it correctly your patch disables the functionality completely? what is the problem with old versions of php? and how old is old?

Yes, it's completely disable offline database, but online check is working properly after that path.

adolfintel commented 3 months ago

When I implemented the offline DB feature I noticed that the maxmind db library required PHP 8. @sstidl initially suggested raising LibreSpeed to a minimum of 8.0, but I implemented a quick and dirty fallback for older versions because I know that there are servers running LS on really old systems.

From what I can see here, your PR improves this workaround, but you really shouldn't rely on it. The newest version of 7.4 is from November 2022, you're putting yourself in danger by exposing it on the internet.

That being said, I'm ok with merging it if @sstidl agrees.

sstidl commented 3 months ago

Okay with me. As said before, php7 or even worse php5 is not supported anymore, so more security fixes there.

IRainman commented 3 months ago

Maybe this repo needs to clean up the support version of PHP for security reason #655