Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23288/include
Modified Files:
functions_comments.inc.php
Log Message:
When previewing an unsaved entry, the $id variable is empty and would
generate a list of all comments available (and probably timeout with many
comments).
Fix that situation by using an empty array for those.
Index: functions_comments.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_comments.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- functions_comments.inc.php 28 Dec 2004 17:49:44 -0000 1.10
+++ functions_comments.inc.php 15 Jan 2005 16:46:48 -0000 1.11
@@ -125,8 +125,12 @@
function serendipity_generateCommentList($id, $comments = NULL, $selected = 0, $parent = 0, $level = 0, $indent = '') {
global $serendipity;
- if ( !is_array($comments) ) {
- $comments = serendipity_fetchComments($id);
+ if (!is_array($comments)) {
+ if (empty($id)) {
+ $comments = array();
+ } else {
+ $comments = serendipity_fetchComments($id);
+ }
}
$retval = $parent ? '' : '<select id="serendipity_replyTo" name="serendipity[replyTo]"><option value="0">[ ' . TOP_LEVEL . ' ]</option>';
|