Commit d96333e3 authored by Mike Hibler's avatar Mike Hibler
Browse files

Mike's quick fix for an image creation problem.

Leigh should do this right!
parent f36bcfab
...@@ -576,7 +576,7 @@ function VerifyPageArguments($argspec, $required) ...@@ -576,7 +576,7 @@ function VerifyPageArguments($argspec, $required)
$imageid = $_REQUEST[URL_IMAGEID]; $imageid = $_REQUEST[URL_IMAGEID];
$yep = 1; $yep = 1;
if (ValidateArgument($name, PAGEARG_UUID, $imageid)) { if (ValidateArgument($name, PAGEARG_UUID, $imageid, 0)) {
$object = Image::LookupByUUID($imageid); $object = Image::LookupByUUID($imageid);
} }
elseif (ValidateArgument($name, PAGEARG_IMAGE, $imageid)) { elseif (ValidateArgument($name, PAGEARG_IMAGE, $imageid)) {
...@@ -728,7 +728,7 @@ function VerifyPageArguments($argspec, $required) ...@@ -728,7 +728,7 @@ function VerifyPageArguments($argspec, $required)
# #
# Validate a single argument is safe to pass along to a DB query. # 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) { switch ($type) {
case PAGEARG_UID: case PAGEARG_UID:
...@@ -793,7 +793,9 @@ function ValidateArgument($name, $type, $arg) ...@@ -793,7 +793,9 @@ function ValidateArgument($name, $type, $arg)
TBERROR("ValidateArgument: ". TBERROR("ValidateArgument: ".
"Unknown argument type - $name", 1); "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; return 0;
} }
?> ?>
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