From: garvinhicking Date: Mon, 23 Oct 2006 07:32:37 +0000 (+0000) Subject: Fix gazillion comment count bug X-Git-Tag: 1.1~68 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7fbc93732b531bb559faf5942b5f40f8838a9091;p=s9y.git Fix gazillion comment count bug --- diff --git a/docs/NEWS b/docs/NEWS index e6c5d36..c65fb6c 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -1,5 +1,12 @@ # $Id$ +Version 1.1 () +------------------------------------------------------------------------ + + * Fix possible integer wraparound in comment count leading to + a gazillion counter state. Also now show links to the entries + within the administration comment panel. Thanks to Julian Finn! + Version 1.1-beta5 (October 18th, 2006) ------------------------------------------------------------------------ diff --git a/include/admin/comments.inc.php b/include/admin/comments.inc.php index 5807f5a..ef0e43d 100644 --- a/include/admin/comments.inc.php +++ b/include/admin/comments.inc.php @@ -10,7 +10,7 @@ if (!serendipity_checkPermission('adminComments')) { return; } -$commentsPerPage = (!empty($serendipity['GET']['filter']['perpage']) ? $serendipity['GET']['filter']['perpage'] : 10); +$commentsPerPage = (int)(!empty($serendipity['GET']['filter']['perpage']) ? $serendipity['GET']['filter']['perpage'] : 10); $summaryLength = 200; if ( $serendipity['POST']['formAction'] == 'multiDelete' && sizeof($serendipity['POST']['delete']) != 0 && serendipity_checkFormToken()) { @@ -114,7 +114,7 @@ if ( isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminActi $filters = array('author', 'email', 'ip', 'url', 'body', 'referer'); /* Compress the filters into an "AND" SQL query, and a querystring */ -foreach ( $filters as $filter ) { +foreach ($filters as $filter) { $and .= (!empty($serendipity['GET']['filter'][$filter]) ? "AND c.". $filter ." LIKE '%". serendipity_db_escape_string($serendipity['GET']['filter'][$filter]) ."%'" : ""); $searchString .= (!empty($serendipity['GET']['filter'][$filter]) ? "&serendipity[filter][". $filter ."]=". $serendipity['GET']['filter'][$filter] : ""); } @@ -139,6 +139,20 @@ if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') { $c_type = null; } +if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') { + $c_type = 'TRACKBACK'; + $searchString .= "&serendipity[filter][type]=TRACKBACK"; +} elseif ($serendipity['GET']['filter']['type'] == 'NORMAL') { + $c_type = 'NORMAL'; + $searchString .= "&serendipity[filter][type]=NORMAL"; +} else { + $c_type = null; +} + +if ($commentsPerPage != 10) { + $searchString .= '&serendipity[filter][perpage]=' . $commentsPerPage; +} + $searchString .= '&' . serendipity_setFormToken('url'); /* Paging */ @@ -171,7 +185,7 @@ function FT_toggle(id) { if ( document.getElementById(id + '_full').style.display == '' ) { document.getElementById(id + '_full').style.display='none'; document.getElementById(id + '_summary').style.display=''; - document.getElementById(id + '_text').innerHTML = ''; + document.getElementById(id + '_text').innerHTML = ''; } else { document.getElementById(id + '_full').style.display=''; document.getElementById(id + '_summary').style.display='none'; @@ -226,7 +240,7 @@ function highlightComment(id, checkvalue) { :