GeoIP: Ignore country codes that aren't country codes: ap (Asia/Pacific), EU, etc.
This commit is contained in:
parent
28f366b686
commit
3a27060503
1
post.php
1
post.php
@ -430,6 +430,7 @@ if (isset($_POST['delete'])) {
|
|||||||
error('GeoIP not available: ' . geoip_db_filename(GEOIP_COUNTRY_EDITION));
|
error('GeoIP not available: ' . geoip_db_filename(GEOIP_COUNTRY_EDITION));
|
||||||
}
|
}
|
||||||
if ($country_code = @geoip_country_code_by_name($_SERVER['REMOTE_ADDR'])) {
|
if ($country_code = @geoip_country_code_by_name($_SERVER['REMOTE_ADDR'])) {
|
||||||
|
if (!in_array(strtolower($country_code), array('eu', 'ap', 'o1', 'a1', 'a2')))
|
||||||
$post['body'] .= "\n<tinyboard flag>" . strtolower($country_code) . "</tinyboard>" .
|
$post['body'] .= "\n<tinyboard flag>" . strtolower($country_code) . "</tinyboard>" .
|
||||||
"\n<tinyboard flag alt>" . @geoip_country_name_by_name($_SERVER['REMOTE_ADDR']) . "</tinyboard>";
|
"\n<tinyboard flag alt>" . @geoip_country_name_by_name($_SERVER['REMOTE_ADDR']) . "</tinyboard>";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user