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