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
+ (#\& "&")
+ (#\< "<")
+ (#\> ">")
+ (#\" """)
+ (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))