Commit 7c1fdd4f authored by Leigh B Stoller's avatar Leigh B Stoller

Renable image constraint checking; fixed the case where an image url is for

the image itself (thus latest version) instead of the more typical version
url.
parent 7ad2db71
......@@ -278,6 +278,35 @@ function Do_GetImageInfo()
" i.image_uuid=v.image_uuid ".
"where v.metadata_url='$safe_url'",
$dblink);
if ($query_result && !mysql_num_rows($query_result)) {
#
# See if the url is for the image instead of a specific
# version.
#
$query = parse_url($urn, PHP_URL_QUERY);
if ($query) {
parse_str($query, $args);
if (isset($args["uuid"]) && IsValidUUID($args["uuid"])) {
$uuid = $args["uuid"];
$query_result =
DBQueryWarn("select i.*,v.* ".
" from image_versions as v ".
" inner join ".
" (select image_uuid, ".
" max(version) as version ".
" from image_versions ".
" where image_uuid='$uuid' ".
" group by image_uuid) as ij ".
" on v.image_uuid=ij.image_uuid and ".
" v.version=ij.version ".
"left join images as i on ".
" i.image_uuid=v.image_uuid",
$dblink);
}
}
}
}
else {
continue;
......
......@@ -704,7 +704,7 @@ function SPITFORM($formfields, $newuser, $errors)
echo " window.MULTISITE = $multisite;\n";
$doconstraints = (isset($this_user) &&
(ISADMINISTRATOR() || STUDLY()) ? 1 : 0);
echo " window.DOCONSTRAINTS = $doconstraints;\n";
echo " window.DOCONSTRAINTS = 1;\n";
echo "</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js?nocache=asdfasdf'></script>\n";
echo "<script src='js/lib/bootstrap.js?nocache=asdfasdf'></script>\n";
......
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