diff -u -r -N glsuck-0.0.1.orig/docs/ChangeLog glsuck-0.0.1/docs/ChangeLog --- glsuck-0.0.1.orig/docs/ChangeLog 2004-11-09 23:44:08.000000000 -0600 +++ glsuck-0.0.1/docs/ChangeLog 2004-11-10 15:48:40.000000000 -0600 @@ -2,7 +2,13 @@ # Copyright (c)2004 badpenguins.com; Distributed under the GPL v2 # -*yasuck-0.0.1 (03 Nov 2004) +*glsuck-0.0.1 (03 Nov 2004) + + 11 Nov 2004; Mike Green docs/ChangeLog, + includes/app.functions.php: + + Fixed bug in comment parsing where an error would return instead of + continue! Woops. 08 Nov 2004; Mike Green docs/ChangeLog, glsuck, includes/app.functions.php, includes/globals.php: @@ -21,4 +27,4 @@ 02 Nov 2004; Mike Green docs/ChangeLog: First rough port from yasuck. - \ No newline at end of file + diff -u -r -N glsuck-0.0.1.orig/includes/app.functions.php glsuck-0.0.1/includes/app.functions.php --- glsuck-0.0.1.orig/includes/app.functions.php 2004-11-09 23:44:08.000000000 -0600 +++ glsuck-0.0.1/includes/app.functions.php 2004-11-10 15:47:29.000000000 -0600 @@ -852,7 +852,7 @@ $pos = strpos($line,""); if ($pos === false) { return false; } $line = substr($line,0,$pos); - return $line; + return trim($line); } return "Anonymous"; @@ -879,7 +879,7 @@ if ($pos1 === false or $pos2 === false or $pos3 === false) { break; } - return str_replace('@','',$line); + return trim(str_replace('@','',$line)); } // newer styles @@ -901,7 +901,7 @@ $pos = strpos($end_str,"<"); if ($pos === false) { return false; } $end_str = substr($end_str,0,$pos); - return $beg_str . $end_str; + return trim($beg_str . $end_str); } return false; @@ -921,7 +921,7 @@ $line = trim($page[$j]); $posbeg = strpos(strtolower($line),$text); if ($posbeg === false) { continue; } - return parseFormInputValue($line,"story"); + return trim(parseFormInputValue($line,"story")); } return false; @@ -1063,7 +1063,7 @@ $line = substr($line,23); $posend = strpos($line,""); if ($posend === false) { break; } - return substr($line,0,$posend); + return trim(substr($line,0,$posend)); } // featured articles @@ -1794,21 +1794,19 @@ //echo "ERROR: could not parse title for comment $comment\n"; //continue; //return false; - $comment_title = "Could not parse"; + $comment_title = "ERROR: UNKNOWN COMMENT TITLE"; } if (!$author = parseCommentAuthor($comment,$page)) { echo "ERROR: cannot determine author for comment $comment\n"; continue; - return false; } if (defined('AUTHOR')) { - if (!(AUTHOR === strtolower($author))) { return true; } + if (!(AUTHOR === strtolower($author))) { continue; } } if ("$author" !== "Anonymous") { if (!$comment_uid = parseCommentUid($comment,$page)) { echo "ERROR: could not determine uid for comment $comment\n"; continue; - return false; } } else { $comment_uid = 0; @@ -1816,20 +1814,17 @@ if (!$comment_date = parseCommentDate($comment,$page)) { echo "ERROR: cannot determine date for comment $comment\n"; continue; - return false; } $comment_pid = parseCommentPid($comment,$page); if ($comment_pid === false) { echo "ERROR: cannot determine pid for comment $comment\n"; continue; - return false; } - if (SKIPCOMMENTS !== true) { + if (!(SKIPCOMMENTS === true)) { $comment_text = parseCommentText($comment,$page); if ($comment_text === false) { echo "ERROR: could not parse text for comment $comment\n"; continue; - return false; } } else { $comment_text = ""; @@ -1840,14 +1835,12 @@ if ($poster_id === false) { echo "ERROR: could not determine poster_id for comment $comment\n"; continue; - return false; } } else { $poster_id = createPosterId($nick_id,$comment_uid,$author); if ($poster_id === false or !is_numeric($poster_id)) { echo "ERROR: could not create poster_id for comment $comment\n"; continue; - return false; } } @@ -1860,13 +1853,12 @@ $sql .= "order by rev DESC limit 1"; if (!$qid = db_query($sql)) { echo "ERROR: could not determine duplicate comment_id\n"; - return false; + continue; } $old_comment = db_result($qid,0,0); $new_comment = md5($comment_text); if ("$old_comment" == "$new_comment") { - return true; - $insert_message = false; + continue; } else { $is_rev = true; $sql = "select max(rev) from comment_ids "; @@ -1874,7 +1866,6 @@ if (!$qid = db_query($sql)) { echo "ERROR: could not determine comment_id rev\n"; continue; - return false; } else { $msg_rev = db_result($qid,0,0) + 1; } @@ -1886,7 +1877,6 @@ if (! $ds = date('Y-m-d H:i:s',strtotime($comment_date))) { echo "ERROR: could not create date for comment $comment\n"; continue; - return false; } $comment = addslashes($comment); @@ -1900,7 +1890,7 @@ $comment_title = addslashes($comment_title); $comment_text = addslashes($comment_text); - if (QUIET !== true) { + if (!(QUIET === true)) { $sub = substr($comment_title,0,40); if (strlen($comment_title) > 40) { $sub .= "..."; @@ -1926,7 +1916,6 @@ echo $msg; } continue; - return false; } } }