[cl-blogger] r15 committed - escape title

2 views
Skip to first unread message

codesite...@google.com

unread,
Nov 21, 2010, 8:29:30 AM11/21/10
to cl-bl...@googlegroups.com
Revision: 15
Author: read.eval.print
Date: Sun Nov 21 05:28:52 2010
Log: escape title

http://code.google.com/p/cl-blogger/source/detail?r=15

Modified:
/trunk/blogger.lisp

=======================================
--- /trunk/blogger.lisp Fri Apr 17 06:34:01 2009
+++ /trunk/blogger.lisp Sun Nov 21 05:28:52 2010
@@ -20,6 +20,16 @@
;; ネームスペースを使わない
(setf s-xml:*ignore-namespaces* t)

+(defun escape-string (string)
+ (with-output-to-string (out)
+ (loop for c across string
+ do (format out "~a" (case c
+ (#\& "&")
+ (#\< "&lt;")
+ (#\> "&gt;")
+ (#\" "&quot;")
+ (t c))))))
+
(defclass blogger ()
((sid :initform nil :accessor sid)
(lsid :initform nil :accessor lsid)
@@ -167,7 +177,7 @@
do (progn
(register-groups-bind (ttl)
("^#title\\s*(.+)" l)
- (or title (setf title ttl)))
+ (or title (setf title (escape-string ttl))))
(register-groups-bind (pstid)
("^; post-id (.+)" l)
(setf post-id pstid))

Reply all
Reply to author
Forward
0 new messages