- Timestamp:
- Nov 26, 2007 11:30:12 PM (16 years ago)
- Location:
- trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/TemplateGlue.inc.php
r254 r290 73 73 $row = mysql_fetch_row($qid); 74 74 if (preg_match('/^enum|^set/i', $row[1]) && preg_match_all("/'([^']*)'/", $row[1], $enum)) { 75 natsort($enum[1]); 75 76 return $enum[1]; 76 77 } else { -
trunk/lib/Utilities.inc.php
r282 r290 849 849 { 850 850 $ip = getenv('HTTP_CLIENT_IP'); 851 if ( empty($ip) || $ip == 'unknown' || $ip == 'localhost' || $ip == '127.0.0.1') {851 if (in_array($ip, array('', 'unknown', 'localhost', '127.0.0.1'))) { 852 852 $ip = getenv('HTTP_X_FORWARDED_FOR'); 853 if (empty($ip) || $ip == 'unknown' || $ip == 'localhost' || $ip == '127.0.0.1') { 853 if (mb_strpos($ip, ',') !== false) { 854 // If HTTP_X_FORWARDED_FOR returns a comma-delimited list of IPs then return the first one (assuming the first is the original). 855 $ips = explode(',', $ip, 2); 856 $ip = $ips[0]; 857 } 858 if (in_array($ip, array('', 'unknown', 'localhost', '127.0.0.1'))) { 854 859 $ip = getenv('REMOTE_ADDR'); 855 860 }
Note: See TracChangeset
for help on using the changeset viewer.