Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
0e9e9ebc
Commit
0e9e9ebc
authored
May 24, 2016
by
Jonathon Duerig
Browse files
Verify that announcement id is an integer before using it.
parent
705c5dbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/aptui/announcement.ajax
View file @
0e9e9ebc
...
...
@@ -24,6 +24,7 @@
chdir
(
".."
);
include_once
(
"webtask.php"
);
include_once
(
"geni_defs.php"
);
include_once
(
"dbcheck.php3"
);
chdir
(
"apt"
);
include_once
(
"profile_defs.php"
);
include_once
(
"instance_defs.php"
);
...
...
@@ -37,7 +38,9 @@ function Do_Dismiss()
$uid_idx
=
$this_user
->
uid_idx
();
$aid
=
$ajax_args
[
'aid'
];
$dblink
=
DBConnect
(
"tbdb"
);
DBQueryWarn
(
'update apt_announcement_info set dismissed=1 where aid="'
.
$aid
.
'" and uid_idx="'
.
$uid_idx
.
'"'
,
$dblink
);
if
(
TBvalid_integer
(
$aid
))
{
DBQueryWarn
(
'update apt_announcement_info set dismissed=1 where aid="'
.
$aid
.
'" and uid_idx="'
.
$uid_idx
.
'"'
,
$dblink
);
}
}
#
...
...
@@ -49,5 +52,7 @@ function Do_Click()
$uid_idx
=
$this_user
->
uid_idx
();
$aid
=
$ajax_args
[
'aid'
];
$dblink
=
DBConnect
(
"tbdb"
);
DBQueryWarn
(
'update apt_announcement_info set clicked=1 where aid="'
.
$aid
.
'" and uid_idx="'
.
$uid_idx
.
'"'
,
$dblink
);
if
(
TBvalid_integer
(
$aid
))
{
DBQueryWarn
(
'update apt_announcement_info set clicked=1 where aid="'
.
$aid
.
'" and uid_idx="'
.
$uid_idx
.
'"'
,
$dblink
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment