Load /tmp/tmp.4vw2vi/nanobloggertrackback-0.2.2 into upstream/0.2.2
authorgregor herrmann <gregoa@debian.org>
Sat, 29 Apr 2006 15:00:27 +0000 (15:00 -0000)
committergregor herrmann <gregoa@debian.org>
Sat, 29 Apr 2006 15:00:27 +0000 (15:00 -0000)
debian/nanobloggertrackback/branches/upstream/current.

ChangeLog [new file with mode: 0644]
README
tb.cgi
trackbackping.sh

diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..9a4e3e3
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,6 @@
+2006-04-29     gregor herrmann <gregor+debian@comodo.priv.at>
+       * nanoblockertrackback 0.2.2:
+               - check for emtpy excerpt on receiving trackback ping
+                 (note: does not conform to trackback specification but helps against spam)
+               - fix error on sending trackback pings when the excerpt contains a ' (single quote)
+                        
diff --git a/README b/README
index 7e421f6612667dcb813bf2dbdf9ee10350f63484..f5f990e6fa9844ddb992b61783947f9cfd751f77 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 nanobloggertrackback - adding trackback functionality to nanoblogger
 ====================================================================
 
-Copyright: gregor herrmann <gregor+debian@comodo.priv.at>, 2005
+Copyright: gregor herrmann <gregor+debian@comodo.priv.at>, 2005, 2006
 License: Released under the GNU GPL (cf. COPYING)
 
 Original tb.cgi:
diff --git a/tb.cgi b/tb.cgi
index 671ebafe25d3389753feb79d32dd556d9f034b79..ee39d89826f230a3a3c42ac23ad1e46efb26553c 100755 (executable)
--- a/tb.cgi
+++ b/tb.cgi
@@ -34,6 +34,8 @@ unless ($mode) {
     $i->{title} ||= $i->{url};
     $i->{timestamp} = time;
     respond_exit("No URL (url)") unless $i->{url};
+    # require excerpt, even if not in TB specification, against spam
+    respond_exit("No excerpt") unless $i->{excerpt};
     my $data = load_data($tb_id);
     unshift @$data, $i;
     store_data($tb_id, $data);
index ceb99301c1b27d98f3ade4bd77a7b23d38f8c958..c66d9daf25cd50a3b3d050182cb2478b48c1bdfe 100644 (file)
@@ -10,7 +10,7 @@ if [ "$SEND_TRACKBACK_PING" = "1" ] && [ ! -z "$TB_PATH" ]; then
                        PING_URL=$URL
                        TITLE=$NB_EntryTitle
                        BLOG_NAME=$BLOG_TITLE
-                       EXCERPT=$(echo $NB_EntryBody | perl -ne 'print "$1 ..." if /^(.{1,80})(\s+|$)/' | html2text -nobs | xargs)
+                       EXCERPT=$(echo $NB_EntryBody | perl -ne 'print "$1 ..." if /^(.{1,80})(\s+|$)/' | html2text -nobs | xargs -0 | head -n -1)
                        URL=${ARCHIVES_PATH}$NB_EntryPermalink
                        TBURL="${TB_PATH}?__mode=send_ping&ping_url=${PING_URL}&title=${TITLE}&blog_name=${BLOG_NAME}&excerpt=${EXCERPT}&url=${URL}"
                        TBURL=$(echo $TBURL | sed -e 's/!/\\!/')