Commit bb5041bb by Scott

Fix errors and inet_ntop warnings

parent 8b026b05
...@@ -549,7 +549,7 @@ ...@@ -549,7 +549,7 @@
} }
if (@$options['whoview']) { if (@$options['whoview']) {
$fields['who']=qa_who_to_html($isbyuser, @$post['userid'], $usershtml, @$options['ipview'] ? inet_ntop()@$post['createip']) : null, $microdata, $post['name']); $fields['who']=qa_who_to_html($isbyuser, @$post['userid'], $usershtml, @$options['ipview'] ? @inet_ntop(@$post['createip']) : null, $microdata, $post['name']);
if (isset($post['points'])) { if (isset($post['points'])) {
if (@$options['pointsview']) if (@$options['pointsview'])
...@@ -628,7 +628,7 @@ ...@@ -628,7 +628,7 @@
} }
if (isset($post['lastuserid']) && @$options['whoview']) if (isset($post['lastuserid']) && @$options['whoview'])
$fields['who_2']=qa_who_to_html(isset($userid) && ($post['lastuserid']==$userid), $post['lastuserid'], $usershtml, @$options['ipview'] ? inet_ntop($post['lastip']) : null, false); $fields['who_2']=qa_who_to_html(isset($userid) && ($post['lastuserid']==$userid), $post['lastuserid'], $usershtml, @$options['ipview'] ? @inet_ntop($post['lastip']) : null, false);
} }
...@@ -890,7 +890,7 @@ ...@@ -890,7 +890,7 @@
if (@$options['whoview']) { if (@$options['whoview']) {
$isbyuser=qa_post_is_by_user(array('userid' => $question['ouserid'], 'cookieid' => @$question['ocookieid']), $userid, $cookieid); $isbyuser=qa_post_is_by_user(array('userid' => $question['ouserid'], 'cookieid' => @$question['ocookieid']), $userid, $cookieid);
$fields['who']=qa_who_to_html($isbyuser, $question['ouserid'], $usershtml, @$options['ipview'] ? inet_ntop(@$question['oip']) : null, false, @$question['oname']); $fields['who']=qa_who_to_html($isbyuser, $question['ouserid'], $usershtml, @$options['ipview'] ? @inet_ntop(@$question['oip']) : null, false, @$question['oname']);
if (isset($question['opoints'])) { if (isset($question['opoints'])) {
if (@$options['pointsview']) if (@$options['pointsview'])
$fields['who']['points']=($question['opoints']==1) ? qa_lang_html_sub_split('main/1_point', '1', '1') $fields['who']['points']=($question['opoints']==1) ? qa_lang_html_sub_split('main/1_point', '1', '1')
......
...@@ -195,7 +195,6 @@ ...@@ -195,7 +195,6 @@
foreach ($results as $result) { foreach ($results as $result) {
$userid=$result['userid']; $userid=$result['userid'];
$result['createip']=inet_ntop($result['createip']);
if (!isset($users[$userid])) { if (!isset($users[$userid])) {
$users[$result['userid']]=$result; $users[$result['userid']]=$result;
......
...@@ -1465,8 +1465,8 @@ ...@@ -1465,8 +1465,8 @@
// add column to qa_users to handle new bcrypt passwords // add column to qa_users to handle new bcrypt passwords
qa_db_upgrade_query('ALTER TABLE ^users ADD COLUMN passhash ' . $definitions['users']['passhash'] . ' AFTER passcheck'); qa_db_upgrade_query('ALTER TABLE ^users ADD COLUMN passhash ' . $definitions['users']['passhash'] . ' AFTER passcheck');
qa_db_upgrade_query($locktablesquery); qa_db_upgrade_query($locktablesquery);
break;
} }
break;
case 63: case 63:
// convert IP addresses to new binary format // convert IP addresses to new binary format
...@@ -1493,7 +1493,6 @@ ...@@ -1493,7 +1493,6 @@
} }
qa_db_upgrade_query($locktablesquery); qa_db_upgrade_query($locktablesquery);
break; break;
}
// Up to here: Version 1.8 alpha // Up to here: Version 1.8 alpha
} }
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
$message['content']=qa_lang_html('users/registered_label').' '. $message['content']=qa_lang_html('users/registered_label').' '.
strtr(qa_lang_html('users/x_ago_from_y'), array( strtr(qa_lang_html('users/x_ago_from_y'), array(
'^1' => qa_time_to_string(qa_opt('db_time')-$user['created']), '^1' => qa_time_to_string(qa_opt('db_time')-$user['created']),
'^2' => qa_ip_anchor_html(inet_ntop($user['createip'])), '^2' => qa_ip_anchor_html(@inet_ntop($user['createip'])),
)).'<br/>'; )).'<br/>';
$htmlemail=qa_html($user['email']); $htmlemail=qa_html($user['email']);
......
...@@ -430,8 +430,8 @@ ...@@ -430,8 +430,8 @@
(!qa_is_http_post()) && (!qa_is_http_post()) &&
qa_is_human_probably() && qa_is_human_probably() &&
( (!$question['views']) || ( // if it has more than zero views ( (!$question['views']) || ( // if it has more than zero views
( (inet_ntop($question['lastviewip'])!=qa_remote_ip_address()) || (!isset($question['lastviewip'])) ) && // then it must be different IP from last view ( (@inet_ntop($question['lastviewip'])!=qa_remote_ip_address()) || (!isset($question['lastviewip'])) ) && // then it must be different IP from last view
( (inet_ntop($question['createip'])!=qa_remote_ip_address()) || (!isset($question['createip'])) ) && // and different IP from the creator ( (@inet_ntop($question['createip'])!=qa_remote_ip_address()) || (!isset($question['createip'])) ) && // and different IP from the creator
( ($question['userid']!=$userid) || (!isset($question['userid'])) ) && // and different user from the creator ( ($question['userid']!=$userid) || (!isset($question['userid'])) ) && // and different user from the creator
( ($question['cookieid']!=$cookieid) || (!isset($question['cookieid'])) ) // and different cookieid from the creator ( ($question['cookieid']!=$cookieid) || (!isset($question['cookieid'])) ) // and different cookieid from the creator
) ) ) )
......
...@@ -583,7 +583,7 @@ ...@@ -583,7 +583,7 @@
'value' => 'value' =>
strtr(qa_lang_html('users/x_ago_from_y'), array( strtr(qa_lang_html('users/x_ago_from_y'), array(
'^1' => qa_time_to_string(qa_opt('db_time')-$useraccount['loggedin']), '^1' => qa_time_to_string(qa_opt('db_time')-$useraccount['loggedin']),
'^2' => qa_ip_anchor_html(inet_ntop($useraccount['loginip'])), '^2' => qa_ip_anchor_html(@inet_ntop($useraccount['loginip'])),
)), )),
'note' => $userediting ? null : qa_lang_html('users/only_shown_moderators'), 'note' => $userediting ? null : qa_lang_html('users/only_shown_moderators'),
'id' => 'lastlogin', 'id' => 'lastlogin',
...@@ -596,7 +596,7 @@ ...@@ -596,7 +596,7 @@
'value' => 'value' =>
strtr(qa_lang_html('users/x_ago_from_y'), array( strtr(qa_lang_html('users/x_ago_from_y'), array(
'^1' => qa_time_to_string(qa_opt('db_time')-$useraccount['written']), '^1' => qa_time_to_string(qa_opt('db_time')-$useraccount['written']),
'^2' => qa_ip_anchor_html(inet_ntop($useraccount['writeip'])), '^2' => qa_ip_anchor_html(@inet_ntop($useraccount['writeip'])),
)), )),
'note' => $userediting ? null : qa_lang_html('users/only_shown_moderators'), 'note' => $userediting ? null : qa_lang_html('users/only_shown_moderators'),
'id' => 'lastwrite', 'id' => 'lastwrite',
......
...@@ -33,7 +33,7 @@ class qa_event_logger ...@@ -33,7 +33,7 @@ class qa_event_logger
return 'CREATE TABLE ^eventlog ('. return 'CREATE TABLE ^eventlog ('.
'datetime DATETIME NOT NULL,'. 'datetime DATETIME NOT NULL,'.
'ipaddress VARBINARY (16),'. 'ipaddress VARCHAR (45),'.
'userid '.qa_get_mysql_user_column_type().','. 'userid '.qa_get_mysql_user_column_type().','.
'handle VARCHAR('.QA_DB_MAX_HANDLE_LENGTH.'),'. 'handle VARCHAR('.QA_DB_MAX_HANDLE_LENGTH.'),'.
'cookieid BIGINT UNSIGNED,'. 'cookieid BIGINT UNSIGNED,'.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment