diff options
author | Nils Adermann <naderman@naderman.de> | 2010-08-21 23:35:43 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-08-21 23:35:43 +0200 |
commit | 2e787fa836dbfdcec7864b5f143520aec3752bd0 (patch) | |
tree | 9d5d9f166d555168d0117163d304041fbcc9f2af /phpBB/includes/functions_user.php | |
parent | 999f6dbc0c8d48a03756d988487341ad1cc15ee6 (diff) | |
parent | 9731f2492f329a35b80483fa7573763b728c4f40 (diff) | |
download | forums-2e787fa836dbfdcec7864b5f143520aec3752bd0.tar forums-2e787fa836dbfdcec7864b5f143520aec3752bd0.tar.gz forums-2e787fa836dbfdcec7864b5f143520aec3752bd0.tar.bz2 forums-2e787fa836dbfdcec7864b5f143520aec3752bd0.tar.xz forums-2e787fa836dbfdcec7864b5f143520aec3752bd0.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus: (57 commits)
Revert "[ticket/7716] Data too long for column 'message_subject'"
[ticket/7716] Data too long for column 'message_subject'
[ticket/9780] Adding unit tests for gen_rand_string().
[ticket/9780] Add length check back to gen_rand_string().
[ticket/7972] Copying topics in the MCP now indexes the new topic.
[ticket/9782] Board disable radio set on when server load high
[ticket/9635] Useless parameter $data['post_time'] in function submit_post.
[ticket/9104] Safari does not display box headers correctly in the ACP.
[ticket/9777] Print error message in pre-commit hook when php is not installed.
[ticket/7716] Data too long for column 'message_subject'
[task/git-tools] Ignore git commit message comments
[task/git-tools] Adjust the hook to enforce that a ticket is always mentioned
[task/git-tools] Vastly expanded commit-msg hook.
[task/git-tools] Beginnings of a syntax checking hook.
[task/git-tools] Append ticket identifier to commit message prior to editing.
[ticket/7332] Redirect users back to post details when performing actions.
[ticket/7332] Collapse post details content down to a maximum of 300px heigh
[ticket/9771] Remove query string parameters that have no name.
[ticket/9760] Remove unrestricted wildcards from search terms.
[ticket/9599] Reimplement phpbb_checkdnsrr() function.
...
Conflicts:
tests/template/template.php
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 6f6d7526b7..d3594196b7 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -766,7 +766,8 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas if (sizeof($ban_other) == 3 && ((int)$ban_other[0] < 9999) && (strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2)) { - $ban_end = max($current_time, gmmktime(0, 0, 0, (int)$ban_other[1], (int)$ban_other[2], (int)$ban_other[0])); + $time_offset = (isset($user->timezone) && isset($user->dst)) ? (int) $user->timezone + (int) $user->dst : 0; + $ban_end = max($current_time, gmmktime(0, 0, 0, (int)$ban_other[1], (int)$ban_other[2], (int)$ban_other[0]) - $time_offset); } else { @@ -1229,22 +1230,39 @@ function user_unban($mode, $ban) } /** -* Whois facility +* Internet Protocol Address Whois +* RFC3912: WHOIS Protocol Specification * -* @link http://tools.ietf.org/html/rfc3912 RFC3912: WHOIS Protocol Specification +* @param string $ip Ip address, either IPv4 or IPv6. +* +* @return string Empty string if not a valid ip address. +* Otherwise make_clickable()'ed whois result. */ function user_ipwhois($ip) { - $ipwhois = ''; + if (empty($ip)) + { + return ''; + } - // Check IP - // Only supporting IPv4 at the moment... - if (empty($ip) || !preg_match(get_preg_expression('ipv4'), $ip)) + if (preg_match(get_preg_expression('ipv4'), $ip)) + { + // IPv4 address + $whois_host = 'whois.arin.net.'; + } + else if (preg_match(get_preg_expression('ipv6'), $ip)) + { + // IPv6 address + $whois_host = 'whois.sixxs.net.'; + } + else { return ''; } - if (($fsk = @fsockopen('whois.arin.net', 43))) + $ipwhois = ''; + + if (($fsk = @fsockopen($whois_host, 43))) { // CRLF as per RFC3912 fputs($fsk, "$ip\r\n"); @@ -1257,7 +1275,7 @@ function user_ipwhois($ip) $match = array(); - // Test for referrals from ARIN to other whois databases, roll on rwhois + // Test for referrals from $whois_host to other whois databases, roll on rwhois if (preg_match('#ReferralServer: whois://(.+)#im', $ipwhois, $match)) { if (strpos($match[1], ':') !== false) @@ -1285,7 +1303,7 @@ function user_ipwhois($ip) @fclose($fsk); } - // Use the result from ARIN if we don't get any result here + // Use the result from $whois_host if we don't get any result here $ipwhois = (empty($buffer)) ? $ipwhois : $buffer; } @@ -2352,7 +2370,7 @@ function avatar_process_user(&$error, $custom_userdata = false, $can_upload = nu } else { - list($sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $sql_ary['user_avatar']); + list($sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . urldecode($sql_ary['user_avatar'])); $sql_ary['user_avatar'] = $category . '/' . $sql_ary['user_avatar']; } } |