Empty commit

This commit is contained in:
Git 2011-10-06 08:00:12 +00:00
parent c9d6291563
commit 157fde11dd
4 changed files with 25 additions and 16 deletions

View File

@ -34,27 +34,26 @@
$Cache->cache_value($Type.'_edits_'.$PostID, $Edits, 0); $Cache->cache_value($Type.'_edits_'.$PostID, $Edits, 0);
} }
list($UserID, $Username, $Time) = $Edits[$Depth];
if($Depth != 0) { if($Depth != 0) {
list($UserID, $Username, $Time, $Body) = $Edits[$Depth - 1]; list(,,,$Body) = $Edits[$Depth - 1];
} else { } else {
//Not an edit, have to get from the original //Not an edit, have to get from the original
switch($Type) { switch($Type) {
case 'forums' : case 'forums' :
//Get from normal forum stuffs //Get from normal forum stuffs
$DB->query("SELECT fp.AuthorID, um.Username, fp.AddedTime, fp.Body $DB->query("SELECT Body
FROM forums_posts AS fp FROM forums_posts
JOIN users_main AS um ON um.ID=fp.AuthorID WHERE ID = ".$PostID);
WHERE fp.ID = ".$PostID); list($Body) = $DB->next_record();
list($UserID, $Username, $Time, $Body) = $DB->next_record();
break; break;
case 'collages' : case 'collages' :
case 'requests' : case 'requests' :
case 'torrents' : case 'torrents' :
$DB->query("SELECT c.AuthorID, um.Username, c.AddedTime, c.Body $DB->query("SELECT Body
FROM ".$Type."_comments AS c FROM ".$Type."_comments
JOIN users_main AS um ON um.ID=c.AuthorID WHERE ID = ".$PostID);
WHERE c.ID = ".$PostID); list($Body) = $DB->next_record();
list($UserID, $Username, $Time, $Body) = $DB->next_record();
break; break;
} }
} }

View File

@ -92,7 +92,7 @@
$DB->query("INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body) $DB->query("INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body)
VALUES ('forums', ".$PostID.", ".$UserID.", '".sqltime()."', '".db_string($OldBody)."')"); VALUES ('forums', ".$PostID.", ".$UserID.", '".sqltime()."', '".db_string($OldBody)."')");
$Cache->delete_value("forums_edits_$PostID");
// This gets sent to the browser, which echoes it in place of the old body // This gets sent to the browser, which echoes it in place of the old body
echo $Text->full_format($_POST['body']); echo $Text->full_format($_POST['body']);
?> ?>

View File

@ -17,11 +17,21 @@
// Check for lame SQL injection attempts // Check for lame SQL injection attempts
if(!isset($_GET['threadid']) || !is_number($_GET['threadid'])) { if(!isset($_GET['threadid']) || !is_number($_GET['threadid'])) {
if(!isset($_GET['topicid']) || !is_number($_GET['topicid'])) { if(isset($_GET['topicid']) && is_number($_GET['topicid'])) {
error('404');
} else {
$ThreadID = $_GET['topicid']; $ThreadID = $_GET['topicid'];
} }
elseif(isset($_GET['postid']) && is_number($_GET['postid'])) {
$DB->query("SELECT TopicID FROM forums_posts WHERE ID = $_GET[postid]");
list($ThreadID) = $DB->next_record();
if($ThreadID) {
header("Location: forums.php?action=viewthread&threadid=$ThreadID&postid=$_GET[postid]#post$_GET[postid]");
die();
} else {
error(404);
}
} else {
error(404);
}
} else { } else {
$ThreadID = $_GET['threadid']; $ThreadID = $_GET['threadid'];
} }

View File

@ -460,7 +460,7 @@
} elseif($EnableUser == '1') { } elseif($EnableUser == '1') {
$Cache->increment('stats_user_count'); $Cache->increment('stats_user_count');
$UpdateSet[]="i.RatioWatchDownload='0'"; $UpdateSet[]="i.RatioWatchDownload='0'";
if ($Cur['Uploaded']/$Cur['Downloaded'] >= $Cur['RequiredRatio']) { if (($Cur['Downloaded'] == 0) || ($Cur['Uploaded']/$Cur['Downloaded'] >= $Cur['RequiredRatio'])) {
$UpdateSet[]="i.RatioWatchEnds='0000-00-00 00:00:00'"; $UpdateSet[]="i.RatioWatchEnds='0000-00-00 00:00:00'";
$CanLeech = 1; $CanLeech = 1;
$UpdateSet[]="m.can_leech='1'"; $UpdateSet[]="m.can_leech='1'";