Yourls: "Cannot redeclare geoip_country_code_by_name()"

Created on 23 Apr 2017  路  3Comments  路  Source: YOURLS/YOURLS

Technical details

  • YOURLS version: master (at e36ec69)
  • PHP version: 5.6.30
  • I'm running Yourls on shared hosting and they have php5-geoip installed

Bug Summary

After pulling recent changes (up to e36ec69) today, I've hit what appears to be a regression of issue #359: I get a blank page and a "Cannot redeclare geoip_country_code_by_name()" (in includes/geo/geoip.inc on line 1602) error in my log.

I can work around the issue by checking out d5a5522, which is the last commit prior to "Update GeoIP" (96a159b).

Most helpful comment

Ah, this explains why I couldn't find on their repo when they removed these checks :) Anyway, this lib is quite a mess, they introduce a class but don't completely use it, the code is not pretty. We'll switch to geoip2 one of these days (or another easy to use lib)

All 3 comments

Thanks for this clear issue.

Indeed, in latest geoip.inc they blindly declare functions while in previous version they declared it only if not existent

God, what an awful lib :) Simple to use, nice overall results, but so badly written :)

I'll revert this update. Again, thanks for the report.

they declared it only if not existent

Ha ha, no, they never, it's _your_ own added declarations! 馃槈
In my last update, all these function checks are re-applied with your previous patch.

Ah, this explains why I couldn't find on their repo when they removed these checks :) Anyway, this lib is quite a mess, they introduce a class but don't completely use it, the code is not pretty. We'll switch to geoip2 one of these days (or another easy to use lib)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lkuza2 picture lkuza2  路  3Comments

Noiden picture Noiden  路  7Comments

youradds picture youradds  路  3Comments

LeoColomb picture LeoColomb  路  3Comments

schapsl picture schapsl  路  4Comments