- if (!($f = @fopen($url, 'r'))) return false;
- global $globals;
- XDB::query('TRUNCATE TABLE geoloc_maps');
- $s = '';
- while (!feof($f)) {
- $l = fgetcsv($f, 1024, ';', '"');
- foreach ($l as $i => $val) if ($val != 'NULL') $l[$i] = '\''.addslashes($val).'\'';
- $s .= ',('.implode(',',$l).')';
- }
- XDB::execute('INSERT INTO geoloc_maps VALUES '.substr($s, 1));
- return true;
+ if (!($f = @fopen($url, 'r'))) {
+ return false;
+ }
+ XDB::query('TRUNCATE TABLE geoloc_maps');
+ $s = '';
+ while (!feof($f)) {
+ $l = fgetcsv($f, 1024, ';', '"');
+ foreach ($l as $i => $val) {
+ if ($val != 'NULL') {
+ $l[$i] = '\''.addslashes($val).'\'';
+ }
+ }
+ $s .= ',('.implode(',',$l).')';
+ }
+ XDB::execute('INSERT INTO geoloc_maps VALUES '.substr($s, 1));
+ return true;