Skip to content
GitLab
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-stable
Commits
d96333e3
Commit
d96333e3
authored
Dec 05, 2014
by
Mike Hibler
Browse files
Mike's quick fix for an image creation problem.
Leigh should do this right!
parent
f36bcfab
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/url_defs.php
View file @
d96333e3
...
...
@@ -576,7 +576,7 @@ function VerifyPageArguments($argspec, $required)
$imageid
=
$_REQUEST
[
URL_IMAGEID
];
$yep
=
1
;
if
(
ValidateArgument
(
$name
,
PAGEARG_UUID
,
$imageid
))
{
if
(
ValidateArgument
(
$name
,
PAGEARG_UUID
,
$imageid
,
0
))
{
$object
=
Image
::
LookupByUUID
(
$imageid
);
}
elseif
(
ValidateArgument
(
$name
,
PAGEARG_IMAGE
,
$imageid
))
{
...
...
@@ -728,7 +728,7 @@ function VerifyPageArguments($argspec, $required)
#
# Validate a single argument is safe to pass along to a DB query.
#
function
ValidateArgument
(
$name
,
$type
,
$arg
)
function
ValidateArgument
(
$name
,
$type
,
$arg
,
$isfatal
=
1
)
{
switch
(
$type
)
{
case
PAGEARG_UID
:
...
...
@@ -793,7 +793,9 @@ function ValidateArgument($name, $type, $arg)
TBERROR
(
"ValidateArgument: "
.
"Unknown argument type -
$name
"
,
1
);
}
PAGEARGERROR
(
"Argument '
$name
' should be of type '
$type
'"
);
if
(
$isfatal
)
{
PAGEARGERROR
(
"Argument '
$name
' should be of type '
$type
'"
);
}
return
0
;
}
?>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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