Changeset 6172 for extensions/whois_online/include/wo_functions.inc.php
- Timestamp:
- May 13, 2010, 9:37:29 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/whois_online/include/wo_functions.inc.php
r5954 r6172 151 151 function whois_country($trace, $bypass = false) { 152 152 if (!isset($trace['country'])) { 153 pwg_query('ALTER TABLE ' . WHOIS_ONLINE_TABLE . ' ADD `country` VARCHAR( 25 5) NOT NULL AFTER `lang` ;');153 pwg_query('ALTER TABLE ' . WHOIS_ONLINE_TABLE . ' ADD `country` VARCHAR( 254 ) NOT NULL AFTER `lang` ;'); 154 154 $trace['country']=''; 155 155 } … … 157 157 if ($trace['country']!='') $c = @unserialize(htmlspecialchars_decode($trace['country'])); 158 158 if (isset($c['Code']) and $c['Code']!='' and $c['Code']!='__') return $c; 159 if ($bypass and isset($c['Code']) and $c['Code']=='__') return $c;159 if ($bypass and isset($c['Code'])) return $c; 160 160 $result = pwg_get_contents ('http://api.hostip.info/get_html.php?ip=' . $trace['IP'], 'r'); 161 161 if ( $result !== false ) { … … 163 163 $c = array ('Name' => $tokens[1], 'City' => substr($tokens[3],0,-3)); 164 164 if (strpos ($c['Name'], '?') === FALSE) { 165 $tokens = preg_split ("/[\(\)]/", $c['Name']); 166 $c['Code'] = isset($tokens[1]) ? $tokens[1]:'__'; 165 $c['Code'] = substr($c['Name'],-8,2); # " (Private Address) (XX) City" 167 166 $c['Name'] = ucwords ( strtolower( substr($c['Name'],0,-5))); 168 167 } … … 170 169 } 171 170 if (stripos($c['Name'], 'Squid')!==false) $c = Array('Code' => '__', 'Name' => l10n('Unknown country'), 'City' => 'N/A',); 172 else $c = Array('Code' => '__', 'Name' => l10n('Unknown country'), 'City' => 'N/A',);171 // else $c = Array('Code' => '__', 'Name' => l10n('Unknown country'), 'City' => 'N/A',); 173 172 if ($c['Code'] == 'Private Address') { 174 173 $c['Name'] = l10n('Private Address'); … … 186 185 function whois_flag($trace, &$step, $limit = 10) { 187 186 $flag = WHOIS_ONLINE_PATH . 'flags/' . $trace['Country']['Code'] . '.jpg'; 188 if (file_exists($flag) ) return $flag;187 if (file_exists($flag) and $flag != '__' ) return $flag; 189 188 if ( $step > $limit ) return WHOIS_ONLINE_PATH . 'flags/__.jpg'; 190 189 $f = fopen ('http://api.hostip.info/flag.php?ip=' . $trace['IP'], 'r');
Note: See TracChangeset
for help on using the changeset viewer.