You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: manage/challenge-response.php
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,14 @@
13
13
14
14
if (isset($_POST['confirm_them']) && isset($_POST['confirm']) && is_array($_POST['confirm'])) {
15
15
foreach ($_POST['confirm'] as$address) {
16
-
$addr = mysql_real_escape_string($address);
17
-
db_query("insert into accounts.confirmed (email, ts) values ('$addr', NOW())");
16
+
db_query_safe("insert into accounts.confirmed (email, ts) values (?, NOW())", [$address]);
18
17
}
19
18
}
20
19
21
-
$user_db = mysql_real_escape_string($user);
22
-
$res = db_query("select distinct sender from phpmasterdb.users left join accounts.quarantine on users.email = rcpt where username='$user_db' and not isnull(id)");
20
+
// TODO: Where does $user come from here?
21
+
$res = db_query_safe(
22
+
"select distinct sender from phpmasterdb.users left join accounts.quarantine on users.email = rcpt " .
23
+
"where username=? and not isnull(id)", [$user]);
23
24
24
25
$inmates = [];
25
26
while ($row = mysql_fetch_row($res)) {
@@ -81,7 +82,9 @@ function sort_by_domain($a, $b)
81
82
</form>
82
83
83
84
<?php
84
-
$res = db_query("select count(id) from phpmasterdb.users left join accounts.quarantine on users.email = rcpt where username='$user_db'");
85
+
$res = db_query_safe(
86
+
"select count(id) from phpmasterdb.users left join accounts.quarantine on users.email = rcpt " .
$resultCount = db_query("SELECT count(votes.id) AS total_votes FROM votes JOIN(note) ON (votes.note_id = note.id) WHERE hostip = $searchip OR ip = $searchip");
161
+
$resultCount = db_query_safe("SELECT count(votes.id) AS total_votes FROM votes JOIN(note) ON (votes.note_id = note.id) WHERE hostip = ? OR ip = ?", [$searchip, $searchip]);
$resultCount = db_query("SELECT count(votes.id) AS total_votes FROM votes JOIN(note) ON (votes.note_id = note.id) WHERE votes.note_id = $search");
172
+
$resultCount = db_query_safe("SELECT count(votes.id) AS total_votes FROM votes JOIN(note) ON (votes.note_id = note.id) WHERE votes.note_id = ?", [$search]);
173
173
$resultCount = mysql_fetch_assoc($resultCount);
174
174
$resultCount = $resultCount['total_votes'];
175
175
$isSearch = '&votessearch=' . hsc($search);
@@ -181,7 +181,7 @@
181
181
}
182
182
} else {
183
183
$isSearch = null;
184
-
$resultCount = db_query("SELECT COUNT(votes.id) AS total_votes FROM votes JOIN(note) ON (votes.note_id = note.id)");
184
+
$resultCount = db_query_safe("SELECT COUNT(votes.id) AS total_votes FROM votes JOIN(note) ON (votes.note_id = note.id)");
0 commit comments