Prefix all GPC variables according to our coding standard
This commit is contained in:
@@ -16,46 +16,46 @@ require(BASE."include/mail.php");
|
||||
|
||||
$aClean = array(); //array of filtered user input
|
||||
|
||||
$aClean['cmd'] = makeSafe($_REQUEST['cmd']);
|
||||
$aClean['versionId'] = makeSafe($_REQUEST['versionId']);
|
||||
$aClean['screenshot_desc'] = makeSafe($_REQUEST['screenshot_desc']);
|
||||
$aClean['imageId'] = makeSafe($_REQUEST['imageId']);
|
||||
$aClean['appId'] = makeSafe($_REQUEST['appId']);
|
||||
$aClean['sCmd'] = makeSafe($_REQUEST['sCmd']);
|
||||
$aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
|
||||
$aClean['sScreenshotDesc'] = makeSafe($_REQUEST['sScreenshotDesc']);
|
||||
$aClean['iImageId'] = makeSafe($_REQUEST['iImageId']);
|
||||
$aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
|
||||
|
||||
/*
|
||||
* We issued a command.
|
||||
*/
|
||||
if($aClean['cmd'])
|
||||
if($aClean['sCmd'])
|
||||
{
|
||||
// process screenshot upload
|
||||
if($aClean['cmd'] == "screenshot_upload")
|
||||
if($aClean['sCmd'] == "screenshot_upload")
|
||||
{
|
||||
if($_FILES['imagefile']['size']>600000)
|
||||
if($_FILES['sImageFile']['size']>600000)
|
||||
{
|
||||
addmsg("Your screenshot was not accepted because it is too big. Please try to keep your screenshots under 600KB by saving games/video screenshots to jpeg and normal applications to png you might be able to achieve very good results with less bytes", "red");
|
||||
} else
|
||||
{
|
||||
$oScreenshot = new Screenshot();
|
||||
$oScreenshot->create($aClean['versionId'], $aClean['screenshot_desc'], $_FILES['imagefile']);
|
||||
$oScreenshot->create($aClean['iVersionId'], $aClean['sScreenshotDesc'], $_FILES['sImageFile']);
|
||||
$oScreenshot->free();
|
||||
}
|
||||
} elseif($aClean['cmd'] == "delete" && is_numeric($aClean['imageId'])) // process screenshot deletion
|
||||
} elseif($aClean['sCmd'] == "delete" && is_numeric($aClean['iImageId'])) // process screenshot deletion
|
||||
{
|
||||
$oScreenshot = new Screenshot($aClean['imageId']);
|
||||
$oScreenshot = new Screenshot($aClean['iImageId']);
|
||||
$oScreenshot->delete();
|
||||
$oScreenshot->free();
|
||||
}
|
||||
redirect(apidb_fullurl("screenshots.php?appId=".$aClean['appId']."&versionId=".$aClean['versionId']));
|
||||
redirect(apidb_fullurl("screenshots.php?iAppId=".$aClean['iAppId']."&iVersionId=".$aClean['iVersionId']));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* We didn't issued any command.
|
||||
*/
|
||||
$hResult = get_screenshots($aClean['appId'], $aClean['versionId']);
|
||||
$hResult = get_screenshots($aClean['iAppId'], $aClean['iVersionId']);
|
||||
apidb_header("Screenshots");
|
||||
$oApp = new Application($aClean['appId']);
|
||||
$oVersion = new Version($aClean['versionId']);
|
||||
$oApp = new Application($aClean['iAppId']);
|
||||
$oVersion = new Version($aClean['iVersionId']);
|
||||
|
||||
if($hResult && mysql_num_rows($hResult))
|
||||
{
|
||||
@@ -66,7 +66,7 @@ if($hResult && mysql_num_rows($hResult))
|
||||
echo "<div align=center><table><tr>\n";
|
||||
while($oRow = mysql_fetch_object($hResult))
|
||||
{
|
||||
if(!$aClean['versionId'] && $oRow->versionId != $currentVersionId)
|
||||
if(!$aClean['iVersionId'] && $oRow->versionId != $currentVersionId)
|
||||
{
|
||||
if($currentVersionId)
|
||||
{
|
||||
@@ -86,9 +86,9 @@ if($hResult && mysql_num_rows($hResult))
|
||||
|
||||
//show admin delete link
|
||||
if($_SESSION['current']->isLoggedIn() && ($_SESSION['current']->hasPriv("admin") ||
|
||||
$_SESSION['current']->isMaintainer($aClean['versionId'])))
|
||||
$_SESSION['current']->isMaintainer($aClean['iVersionId'])))
|
||||
{
|
||||
echo "<br />[<a href='screenshots.php?cmd=delete&imageId=$oRow->id&appId=".$aClean['appId']."&versionId=".$aClean['versionId']."'>Delete Image</a>]";
|
||||
echo "<br />[<a href='screenshots.php?sCmd=delete&iImageId=$oRow->id&iAppId=".$aClean['iAppId']."&iVersionId=".$aClean['iVersionId']."'>Delete Image</a>]";
|
||||
}
|
||||
|
||||
echo "</div></td>\n";
|
||||
@@ -106,22 +106,22 @@ if($hResult && mysql_num_rows($hResult))
|
||||
echo "<br />Please consider submitting a screenshot for the selected version yourself.</p>";
|
||||
}
|
||||
|
||||
if($aClean['versionId'])
|
||||
if($aClean['iVersionId'])
|
||||
{
|
||||
//image upload box
|
||||
echo '<form enctype="multipart/form-data" action="screenshots.php" name="imageForm" method="post">',"\n";
|
||||
echo '<form enctype="multipart/form-data" action="screenshots.php" name="sImageForm" method="post">',"\n";
|
||||
echo html_frame_start("Upload Screenshot","400","",0);
|
||||
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
|
||||
|
||||
echo '<tr><td class=color1>Image</td><td class=color0><input name="imagefile" type="file" size="24"></td></tr>',"\n";
|
||||
echo '<tr><td class="color1">Description</td><td class="color0"><input type="text" name="screenshot_desc" maxlength="20" size="24"></td></tr>',"\n";
|
||||
echo '<tr><td class=color1>Image</td><td class=color0><input name="sImageFile" type="file" size="24"></td></tr>',"\n";
|
||||
echo '<tr><td class="color1">Description</td><td class="color0"><input type="text" name="sScreenshotDesc" maxlength="20" size="24"></td></tr>',"\n";
|
||||
|
||||
echo '<tr><td colspan=2 align=center class=color3><input type="submit" value="Send File"></td></tr>',"\n";
|
||||
echo '</table>',"\n";
|
||||
echo html_frame_end();
|
||||
echo '<input type="hidden" name="MAX_FILE_SIZE" value="4000000" />',"\n";
|
||||
echo '<input type="hidden" name="cmd" value="screenshot_upload" />',"\n";
|
||||
echo '<input type="hidden" name="versionId" value="'.$aClean['versionId'].'"></form />',"\n";
|
||||
echo '<input type="hidden" name="sCmd" value="screenshot_upload" />',"\n";
|
||||
echo '<input type="hidden" name="iVersionId" value="'.$aClean['iVersionId'].'"></form />',"\n";
|
||||
}
|
||||
echo html_back_link(1);
|
||||
apidb_footer();
|
||||
|
||||
Reference in New Issue
Block a user