Artifact
0b79e98f297dd613e78ba167efcbf220431c8ac1:
0000: 3b 3b 20 43 6f 70 79 72 69 67 68 74 20 32 30 30 ;; Copyright 200
0010: 37 2d 32 30 30 38 2c 20 4d 61 74 74 68 65 77 20 7-2008, Matthew
0020: 57 65 6c 6c 61 6e 64 2e 0a 3b 3b 20 0a 3b 3b 20 Welland..;; .;;
0030: 20 54 68 69 73 20 70 72 6f 67 72 61 6d 20 69 73 This program is
0040: 20 6d 61 64 65 20 61 76 61 69 6c 61 62 6c 65 20 made available
0050: 75 6e 64 65 72 20 74 68 65 20 47 4e 55 20 47 50 under the GNU GP
0060: 4c 20 76 65 72 73 69 6f 6e 20 32 2e 30 20 6f 72 L version 2.0 or
0070: 0a 3b 3b 20 20 67 72 65 61 74 65 72 2e 20 53 65 .;; greater. Se
0080: 65 20 74 68 65 20 61 63 63 6f 6d 70 61 6e 79 69 e the accompanyi
0090: 6e 67 20 66 69 6c 65 20 43 4f 50 59 49 4e 47 20 ng file COPYING
00a0: 66 6f 72 20 64 65 74 61 69 6c 73 2e 0a 3b 3b 20 for details..;;
00b0: 0a 3b 3b 20 20 54 68 69 73 20 70 72 6f 67 72 61 .;; This progra
00c0: 6d 20 69 73 20 64 69 73 74 72 69 62 75 74 65 64 m is distributed
00d0: 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 52 WITHOUT ANY WAR
00e0: 52 41 4e 54 59 3b 20 77 69 74 68 6f 75 74 20 65 RANTY; without e
00f0: 76 65 6e 20 74 68 65 0a 3b 3b 20 20 69 6d 70 6c ven the.;; impl
0100: 69 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 20 ied warranty of
0110: 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 20 MERCHANTABILITY
0120: 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 41 or FITNESS FOR A
0130: 20 50 41 52 54 49 43 55 4c 41 52 0a 3b 3b 20 20 PARTICULAR.;;
0140: 50 55 52 50 4f 53 45 2e 0a 0a 3b 3b 20 0a 28 64 PURPOSE...;; .(d
0150: 65 66 69 6e 65 20 28 73 3a 73 70 6c 69 74 2d 73 efine (s:split-s
0160: 74 72 69 6e 67 20 73 74 72 6e 67 20 64 65 6c 69 tring strng deli
0170: 6d 29 0a 20 20 28 69 66 20 28 65 71 3f 20 28 73 m). (if (eq? (s
0180: 74 72 69 6e 67 2d 6c 65 6e 67 74 68 20 73 74 72 tring-length str
0190: 6e 67 29 20 30 29 20 28 6c 69 73 74 20 73 74 72 ng) 0) (list str
01a0: 6e 67 29 0a 20 20 20 20 20 20 28 6c 65 74 20 6c ng). (let l
01b0: 6f 6f 70 20 28 28 68 65 61 64 20 28 6d 61 6b 65 oop ((head (make
01c0: 2d 73 74 72 69 6e 67 20 31 20 28 63 61 72 20 28 -string 1 (car (
01d0: 73 74 72 69 6e 67 2d 3e 6c 69 73 74 20 73 74 72 string->list str
01e0: 6e 67 29 29 29 29 0a 09 09 20 28 74 61 69 6c 20 ng))))... (tail
01f0: 28 63 64 72 20 28 73 74 72 69 6e 67 2d 3e 6c 69 (cdr (string->li
0200: 73 74 20 73 74 72 6e 67 29 29 29 0a 09 09 20 28 st strng)))... (
0210: 64 65 73 74 20 27 28 29 29 0a 09 09 20 28 74 65 dest '())... (te
0220: 6d 70 20 22 22 29 29 0a 09 28 63 6f 6e 64 20 28 mp ""))..(cond (
0230: 28 65 71 75 61 6c 3f 20 68 65 61 64 20 64 65 6c (equal? head del
0240: 69 6d 29 0a 09 20 20 20 20 20 20 20 28 73 65 74 im).. (set
0250: 21 20 64 65 73 74 20 28 61 70 70 65 6e 64 20 64 ! dest (append d
0260: 65 73 74 20 28 6c 69 73 74 20 74 65 6d 70 29 29 est (list temp))
0270: 29 0a 09 20 20 20 20 20 20 20 28 73 65 74 21 20 ).. (set!
0280: 74 65 6d 70 20 22 22 29 29 0a 09 20 20 20 20 20 temp ""))..
0290: 20 28 28 6e 75 6c 6c 3f 20 68 65 61 64 29 20 0a ((null? head) .
02a0: 09 20 20 20 20 20 20 20 28 73 65 74 21 20 64 65 . (set! de
02b0: 73 74 20 28 61 70 70 65 6e 64 20 64 65 73 74 20 st (append dest
02c0: 28 6c 69 73 74 20 74 65 6d 70 29 29 29 29 0a 09 (list temp))))..
02d0: 20 20 20 20 20 20 28 65 6c 73 65 20 28 73 65 74 (else (set
02e0: 21 20 74 65 6d 70 20 28 73 74 72 69 6e 67 2d 61 ! temp (string-a
02f0: 70 70 65 6e 64 20 74 65 6d 70 20 68 65 61 64 29 ppend temp head)
0300: 29 29 29 20 3b 3b 20 65 6e 64 20 69 66 0a 09 28 ))) ;; end if..(
0310: 63 6f 6e 64 20 28 28 6e 75 6c 6c 3f 20 74 61 69 cond ((null? tai
0320: 6c 29 0a 09 20 20 20 20 20 20 20 28 73 65 74 21 l).. (set!
0330: 20 64 65 73 74 20 28 61 70 70 65 6e 64 20 64 65 dest (append de
0340: 73 74 20 28 6c 69 73 74 20 74 65 6d 70 29 29 29 st (list temp)))
0350: 20 64 65 73 74 29 0a 09 20 20 20 20 20 20 28 65 dest).. (e
0360: 6c 73 65 20 28 6c 6f 6f 70 20 28 6d 61 6b 65 2d lse (loop (make-
0370: 73 74 72 69 6e 67 20 31 20 28 63 61 72 20 74 61 string 1 (car ta
0380: 69 6c 29 29 20 28 63 64 72 20 74 61 69 6c 29 20 il)) (cdr tail)
0390: 64 65 73 74 20 74 65 6d 70 29 29 29 29 29 29 0a dest temp)))))).
03a0: 0a 3b 3b 20 61 6c 6c 6f 77 65 64 2d 74 61 67 73 .;; allowed-tags
03b0: 20 69 73 20 61 20 6c 69 73 74 20 6f 66 20 74 61 is a list of ta
03c0: 67 73 20 61 73 20 73 79 6d 62 6f 6c 73 3a 0a 3b gs as symbols:.;
03d0: 3b 20 20 20 27 28 61 20 62 20 63 65 6e 74 65 72 ; '(a b center
03e0: 20 70 20 61 29 0a 3b 3b 20 70 61 72 73 69 6e 67 p a).;; parsing
03f0: 20 69 73 20 73 69 6d 70 6c 69 73 74 69 63 20 61 is simplistic a
0400: 6e 64 20 74 68 65 20 72 65 73 70 6f 6e 73 65 20 nd the response
0410: 63 6f 6e 73 65 72 76 61 74 69 76 65 0a 3b 3b 20 conservative.;;
0420: 69 66 20 61 20 3c 20 69 73 20 66 6f 75 6e 64 20 if a < is found
0430: 77 69 74 68 6f 75 74 20 74 68 65 20 74 61 67 20 without the tag
0440: 61 6e 64 20 63 6c 6f 73 69 6e 67 20 3e 20 74 68 and closing > th
0450: 65 6e 0a 3b 3b 20 74 68 65 20 3c 20 6f 72 20 3e en.;; the < or >
0460: 20 69 73 20 72 65 70 6c 61 63 65 64 20 77 69 74 is replaced wit
0470: 68 20 26 6c 74 3b 20 6f 72 20 26 67 74 3b 20 77 h < or > w
0480: 69 74 68 6f 75 74 20 0a 3b 3b 20 65 76 65 6e 20 ithout .;; even
0490: 74 72 79 69 6e 67 20 68 61 72 64 20 74 6f 20 66 trying hard to f
04a0: 69 67 75 72 65 20 6f 75 74 20 69 66 20 74 68 65 igure out if the
04b0: 72 65 20 69 73 20 61 20 6c 65 67 69 74 20 74 61 re is a legit ta
04c0: 67 20 0a 3b 3b 20 62 75 72 69 65 64 20 69 6e 20 g .;; buried in
04d0: 74 68 65 20 74 65 78 74 20 73 6f 6d 65 77 68 65 the text somewhe
04e0: 72 65 2e 0a 3b 3b 20 61 20 6c 69 73 74 20 6f 66 re..;; a list of
04f0: 20 73 74 72 69 6e 67 73 20 69 73 20 72 65 74 75 strings is retu
0500: 72 6e 65 64 2e 0a 3b 3b 0a 3b 3b 20 4e 4f 54 45 rned..;;.;; NOTE
0510: 53 0a 3b 3b 20 31 2e 20 63 61 73 65 20 69 73 20 S.;; 1. case is
0520: 69 6d 70 6f 72 74 61 6e 74 20 69 6e 20 74 68 65 important in the
0530: 20 61 6c 6c 6f 77 65 64 2d 74 61 67 73 20 6c 69 allowed-tags li
0540: 73 74 21 0a 3b 3b 20 32 2e 20 6f 6e 6c 79 20 22 st!.;; 2. only "
0550: 73 6f 6c 69 64 22 20 74 61 67 73 20 61 72 65 20 solid" tags are
0560: 73 75 70 70 6f 72 74 65 64 20 69 2e 65 2e 20 3c supported i.e. <
0570: 61 20 68 72 65 66 3d 22 66 6f 6f 22 3e 20 77 69 a href="foo"> wi
0580: 6c 6c 20 6e 6f 74 20 77 6f 72 6b 3f 0a 3b 3b 0a ll not work?.;;.
0590: 0a 3b 3b 20 28 73 3a 63 67 69 2d 6f 75 74 20 28 .;; (s:cgi-out (
05a0: 65 76 61 6c 20 28 73 3a 6f 75 74 70 75 74 20 28 eval (s:output (
05b0: 73 3a 68 74 6d 6c 2d 66 69 6c 74 65 72 20 22 68 s:html-filter "h
05c0: 65 6c 6c 6f 3c 62 3e 67 6f 6f 64 62 79 65 3c 2f ello<b>goodbye</
05d0: 62 3e 3c 62 3e 20 65 68 22 20 27 28 61 20 62 20 b><b> eh" '(a b
05e0: 69 29 29 29 29 0a 0a 3b 3b 20 73 74 72 61 74 65 i))))..;; strate
05f0: 67 79 0a 3b 3b 20 31 2e 20 63 6f 6e 76 65 72 74 gy.;; 1. convert
0600: 20 5c 6e 20 74 6f 20 3c 6c 69 6e 65 66 65 65 64 \n to <linefeed
0610: 3e 0a 3b 3b 20 32 2e 20 53 70 6c 69 74 20 6f 6e >.;; 2. Split on
0620: 20 22 3c 22 0a 3b 3b 20 33 2e 20 53 70 6c 69 74 "<".;; 3. Split
0630: 20 6f 6e 20 22 3e 22 0a 3b 3b 20 34 2e 20 46 69 on ">".;; 4. Fi
0640: 78 0a 28 64 65 66 69 6e 65 20 28 73 3a 68 74 6d x.(define (s:htm
0650: 6c 2d 66 69 6c 74 65 72 20 69 6e 70 75 74 2d 74 l-filter input-t
0660: 65 78 74 20 61 6c 6c 6f 77 65 64 2d 74 61 67 73 ext allowed-tags
0670: 29 0a 20 20 28 6c 65 74 2a 20 28 28 74 6f 6b 73 ). (let* ((toks
0680: 20 20 20 28 73 3a 73 74 72 2d 3e 74 6f 6b 73 20 (s:str->toks
0690: 69 6e 70 75 74 2d 74 65 78 74 29 29 0a 09 20 28 input-text)).. (
06a0: 74 6d 70 20 20 20 20 28 73 3a 74 6f 6b 73 2d 3e tmp (s:toks->
06b0: 73 74 6d 6c 20 27 28 73 3a 6e 75 6c 6c 29 20 23 stml '(s:null) #
06c0: 66 20 74 6f 6b 73 20 61 6c 6c 6f 77 65 64 2d 74 f toks allowed-t
06d0: 61 67 73 29 29 0a 09 20 28 72 65 73 20 20 20 20 ags)).. (res
06e0: 28 63 61 72 20 74 6d 70 29 29 0a 09 20 28 6e 78 (car tmp)).. (nx
06f0: 74 74 61 67 20 28 63 61 64 72 20 74 6d 70 29 29 ttag (cadr tmp))
0700: 0a 09 20 28 72 65 6d 20 20 20 20 28 63 61 64 64 .. (rem (cadd
0710: 72 20 74 6d 70 29 29 29 0a 20 20 20 20 72 65 73 r tmp))). res
0720: 29 29 0a 0a 28 64 65 66 69 6e 65 20 28 73 3a 68 ))..(define (s:h
0730: 74 6d 6c 2d 66 69 6c 74 65 72 2d 3e 73 74 72 69 tml-filter->stri
0740: 6e 67 20 69 6e 70 75 74 2d 74 65 78 74 20 61 6c ng input-text al
0750: 6c 6f 77 65 64 2d 74 61 67 73 29 0a 20 20 28 6c lowed-tags). (l
0760: 65 74 20 28 28 6f 73 74 72 20 28 6f 70 65 6e 2d et ((ostr (open-
0770: 6f 75 74 70 75 74 2d 73 74 72 69 6e 67 29 29 29 output-string)))
0780: 0a 20 20 20 20 3b 3b 3b 20 28 73 3a 6f 75 74 70 . ;;; (s:outp
0790: 75 74 2d 6e 65 77 20 6f 73 74 72 20 28 73 3a 68 ut-new ostr (s:h
07a0: 74 6d 6c 2d 66 69 6c 74 65 72 20 69 6e 70 75 74 tml-filter input
07b0: 2d 74 65 78 74 20 61 6c 6c 6f 77 65 64 2d 74 61 -text allowed-ta
07c0: 67 73 29 29 0a 20 20 20 20 28 73 3a 6f 75 74 70 gs)). (s:outp
07d0: 75 74 2d 6e 65 77 20 6f 73 74 72 20 28 63 61 72 ut-new ostr (car
07e0: 20 28 65 76 61 6c 20 28 73 3a 68 74 6d 6c 2d 66 (eval (s:html-f
07f0: 69 6c 74 65 72 20 69 6e 70 75 74 2d 74 65 78 74 ilter input-text
0800: 20 61 6c 6c 6f 77 65 64 2d 74 61 67 73 29 29 29 allowed-tags)))
0810: 29 0a 20 20 20 20 28 67 65 74 2d 6f 75 74 70 75 ). (get-outpu
0820: 74 2d 73 74 72 69 6e 67 20 6f 73 74 72 29 29 29 t-string ostr)))
0830: 0a 09 0a 3b 3b 20 20 20 20 20 28 69 66 20 28 6e ...;; (if (n
0840: 75 6c 6c 3f 20 72 65 6d 29 0a 3b 3b 20 09 72 65 ull? rem).;; .re
0850: 73 20 27 28 29 29 0a 3b 3b 20 09 28 73 3a 74 6f s '()).;; .(s:to
0860: 6b 73 2d 3e 73 74 6d 6c 20 28 69 66 20 28 6c 69 ks->stml (if (li
0870: 73 74 3f 20 72 65 73 29 20 72 65 73 20 27 28 29 st? res) res '()
0880: 29 20 23 66 20 72 65 6d 20 61 6c 6c 6f 77 65 64 ) #f rem allowed
0890: 2d 74 61 67 73 29 29 29 29 0a 0a 28 64 65 66 69 -tags))))..(defi
08a0: 6e 65 20 28 73 3a 73 74 72 2d 3e 74 6f 6b 73 20 ne (s:str->toks
08b0: 73 74 72 29 0a 20 20 28 61 70 70 6c 79 20 61 70 str). (apply ap
08c0: 70 65 6e 64 20 28 6d 61 70 20 28 6c 61 6d 62 64 pend (map (lambd
08d0: 61 20 28 74 6f 6b 29 0a 09 09 20 20 20 20 20 20 a (tok)...
08e0: 20 28 69 6e 74 65 72 73 70 65 72 73 65 20 28 73 (intersperse (s
08f0: 3a 73 70 6c 69 74 2d 73 74 72 69 6e 67 20 74 6f :split-string to
0900: 6b 20 22 3e 22 29 20 22 3e 22 29 29 20 0a 09 09 k ">") ">")) ...
0910: 20 20 20 20 20 28 69 6e 74 65 72 73 70 65 72 73 (interspers
0920: 65 20 28 73 3a 73 70 6c 69 74 2d 73 74 72 69 6e e (s:split-strin
0930: 67 20 73 74 72 20 22 3c 22 29 20 22 3c 22 29 29 g str "<") "<"))
0940: 29 29 0a 0a 28 64 65 66 69 6e 65 20 28 73 3a 74 ))..(define (s:t
0950: 61 67 2d 3e 73 74 6d 6c 20 74 61 67 29 0a 20 20 ag->stml tag).
0960: 28 73 74 72 69 6e 67 2d 3e 73 79 6d 62 6f 6c 20 (string->symbol
0970: 28 73 74 72 69 6e 67 2d 61 70 70 65 6e 64 20 22 (string-append "
0980: 73 3a 22 20 28 73 79 6d 62 6f 6c 2d 3e 73 74 72 s:" (symbol->str
0990: 69 6e 67 20 74 61 67 29 29 29 29 0a 0a 0a 28 64 ing tag))))...(d
09a0: 65 66 69 6e 65 20 28 73 3a 74 6f 6b 73 2d 3e 73 efine (s:toks->s
09b0: 74 6d 6c 20 72 65 73 20 74 61 67 20 72 65 6d 20 tml res tag rem
09c0: 61 6c 6c 6f 77 65 64 29 0a 20 20 3b 3b 20 28 70 allowed). ;; (p
09d0: 72 69 6e 74 20 22 74 61 67 3a 20 22 20 74 61 67 rint "tag: " tag
09e0: 20 22 20 72 65 6d 3a 20 22 20 72 65 6d 29 0a 20 " rem: " rem).
09f0: 20 28 69 66 20 28 6e 75 6c 6c 3f 20 72 65 6d 29 (if (null? rem)
0a00: 0a 20 20 20 20 20 20 28 6c 69 73 74 20 28 61 70 . (list (ap
0a10: 70 65 6e 64 20 72 65 73 20 28 69 66 20 74 61 67 pend res (if tag
0a20: 0a 09 09 09 20 20 20 20 28 6c 69 73 74 20 28 73 .... (list (s
0a30: 3a 74 61 67 2d 3e 73 74 6d 6c 20 74 61 67 29 29 :tag->stml tag))
0a40: 0a 09 09 09 09 27 28 29 29 29 20 23 66 20 27 28 .....'())) #f '(
0a50: 29 20 61 6c 6c 6f 77 65 64 29 20 3b 3b 20 74 68 ) allowed) ;; th
0a60: 65 20 63 61 73 65 20 6f 66 20 61 20 6c 6f 6e 65 e case of a lone
0a70: 20 74 61 67 20 0a 20 20 20 20 20 20 3b 3b 20 68 tag . ;; h
0a80: 61 6e 64 6c 65 20 61 20 73 74 61 72 74 69 6e 67 andle a starting
0a90: 20 74 61 67 0a 20 20 20 20 20 20 28 6c 65 74 2a tag. (let*
0aa0: 20 28 28 74 6d 70 20 20 20 20 20 20 20 28 73 3a ((tmp (s:
0ab0: 75 70 74 6f 2d 74 61 67 20 72 65 6d 20 61 6c 6c upto-tag rem all
0ac0: 6f 77 65 64 29 29 0a 09 20 20 20 20 20 28 74 78 owed)).. (tx
0ad0: 74 20 20 20 20 20 20 20 28 63 61 72 20 74 6d 70 t (car tmp
0ae0: 29 29 20 20 20 20 20 20 3b 3b 20 74 68 69 73 20 )) ;; this
0af0: 74 78 74 20 67 6f 65 73 20 77 69 74 68 20 74 61 txt goes with ta
0b00: 67 21 21 21 0a 09 20 20 20 20 20 28 6e 65 78 74 g!!!.. (next
0b10: 74 61 67 20 20 20 28 63 61 64 72 20 74 6d 70 29 tag (cadr tmp)
0b20: 29 20 20 20 20 20 3b 3b 20 74 68 69 73 20 69 73 ) ;; this is
0b30: 20 74 68 65 20 4e 45 58 54 20 44 41 4d 4e 20 74 the NEXT DAMN t
0b40: 61 67 21 0a 09 20 20 20 20 20 28 62 65 67 69 6e ag!.. (begin
0b50: 2d 74 61 67 20 28 63 61 64 64 72 20 74 6d 70 29 -tag (caddr tmp)
0b60: 29 0a 09 20 20 20 20 20 28 6e 65 77 72 65 6d 20 ).. (newrem
0b70: 20 20 20 28 63 61 64 64 64 72 20 74 6d 70 29 29 (cadddr tmp))
0b80: 29 0a 09 3b 3b 20 28 70 72 69 6e 74 20 22 74 78 )..;; (print "tx
0b90: 74 3a 20 20 20 20 20 20 20 20 22 20 74 78 74 20 t: " txt
0ba0: 22 5c 6e 6e 65 78 74 74 61 67 3a 20 20 20 20 22 "\nnexttag: "
0bb0: 20 6e 65 78 74 74 61 67 20 22 5c 6e 62 65 67 69 nexttag "\nbegi
0bc0: 6e 2d 74 61 67 3a 20 20 22 20 62 65 67 69 6e 2d n-tag: " begin-
0bd0: 74 61 67 20 22 5c 6e 6e 65 77 72 65 6d 3a 20 20 tag "\nnewrem:
0be0: 20 20 20 22 20 6e 65 77 72 65 6d 20 22 5c 6e 72 " newrem "\nr
0bf0: 65 73 3a 20 20 20 20 20 20 20 20 22 20 72 65 73 es: " res
0c00: 20 22 5c 6e 22 29 0a 09 28 69 66 20 62 65 67 69 "\n")..(if begi
0c10: 6e 2d 74 61 67 20 3b 3b 20 6e 65 73 74 20 74 68 n-tag ;; nest th
0c20: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 73 74 75 66 e following stuf
0c30: 66 0a 09 20 20 20 20 28 6c 65 74 2a 20 28 28 63 f.. (let* ((c
0c40: 68 69 6c 64 64 61 74 20 28 73 3a 74 6f 6b 73 2d hilddat (s:toks-
0c50: 3e 73 74 6d 6c 20 27 28 29 20 6e 65 78 74 74 61 >stml '() nextta
0c60: 67 20 6e 65 77 72 65 6d 20 61 6c 6c 6f 77 65 64 g newrem allowed
0c70: 29 29 0a 09 09 20 20 20 28 63 68 69 6c 64 20 20 ))... (child
0c80: 20 20 28 63 61 72 20 63 68 69 6c 64 64 61 74 29 (car childdat)
0c90: 29 0a 09 09 20 20 20 28 6e 65 77 74 61 67 20 20 )... (newtag
0ca0: 20 28 63 61 64 72 20 63 68 69 6c 64 64 61 74 29 (cadr childdat)
0cb0: 29 0a 09 09 20 20 20 28 6e 65 77 72 65 6d 32 20 )... (newrem2
0cc0: 20 28 63 61 64 64 72 20 63 68 69 6c 64 64 61 74 (caddr childdat
0cd0: 29 29 0a 09 09 20 20 20 28 61 6c 6c 6f 77 65 64 ))... (allowed
0ce0: 20 20 28 63 61 64 64 64 72 20 63 68 69 6c 64 64 (cadddr childd
0cf0: 61 74 29 29 29 20 3b 3b 20 79 61 2c 20 69 74 20 at))) ;; ya, it
0d00: 73 68 6f 75 6c 64 6e 27 74 20 68 61 76 65 20 63 shouldn't have c
0d10: 68 61 6e 67 65 64 0a 09 20 20 20 20 20 20 28 69 hanged.. (i
0d20: 66 20 74 61 67 20 0a 09 09 20 20 28 73 3a 74 6f f tag ... (s:to
0d30: 6b 73 2d 3e 73 74 6d 6c 20 28 61 70 70 65 6e 64 ks->stml (append
0d40: 20 72 65 73 20 28 6c 69 73 74 20 28 61 70 70 65 res (list (appe
0d50: 6e 64 20 28 6c 69 73 74 20 28 73 3a 74 61 67 2d nd (list (s:tag-
0d60: 3e 73 74 6d 6c 20 74 61 67 29 29 20 63 68 69 6c >stml tag)) chil
0d70: 64 20 28 6c 69 73 74 20 74 78 74 29 29 29 29 0a d (list txt)))).
0d80: 09 09 09 09 6e 65 77 74 61 67 20 6e 65 77 72 65 ....newtag newre
0d90: 6d 32 20 61 6c 6c 6f 77 65 64 29 0a 09 09 20 20 m2 allowed)...
0da0: 28 73 3a 74 6f 6b 73 2d 3e 73 74 6d 6c 20 28 61 (s:toks->stml (a
0db0: 70 70 65 6e 64 20 72 65 73 20 28 6c 69 73 74 20 ppend res (list
0dc0: 74 78 74 29 20 63 68 69 6c 64 29 0a 09 09 09 09 txt) child).....
0dd0: 6e 65 77 74 61 67 20 6e 65 77 72 65 6d 32 20 61 newtag newrem2 a
0de0: 6c 6c 6f 77 65 64 29 29 29 0a 09 20 20 20 20 3b llowed))).. ;
0df0: 3b 20 69 74 20 6d 75 73 74 20 68 61 76 65 20 62 ; it must have b
0e00: 65 65 6e 20 61 6e 20 65 6e 64 20 74 61 67 0a 09 een an end tag..
0e10: 20 20 20 20 28 6c 69 73 74 20 28 61 70 70 65 6e (list (appen
0e20: 64 20 72 65 73 20 28 6c 69 73 74 20 0a 09 09 09 d res (list ....
0e30: 20 20 20 20 20 20 20 28 69 66 20 74 61 67 0a 09 (if tag..
0e40: 09 09 09 20 20 20 28 6c 69 73 74 20 28 73 3a 74 ... (list (s:t
0e50: 61 67 2d 3e 73 74 6d 6c 20 74 61 67 29 20 74 78 ag->stml tag) tx
0e60: 74 29 0a 09 09 09 09 20 20 20 74 78 74 29 29 29 t)..... txt)))
0e70: 0a 09 09 20 20 23 66 0a 09 09 20 20 6e 65 77 72 ... #f... newr
0e80: 65 6d 0a 09 09 20 20 61 6c 6c 6f 77 65 64 29 29 em... allowed))
0e90: 29 29 29 0a 0a 0a 3b 3b 20 22 3c 22 20 22 62 22 )))...;; "<" "b"
0ea0: 20 22 3e 22 20 20 3d 3e 20 22 3c 62 3e 22 0a 3b ">" => "<b>".;
0eb0: 3b 20 22 3c 22 0a 3b 3b 20 28 64 65 66 69 6e 65 ; "<".;; (define
0ec0: 20 28 73 3a 72 65 62 75 69 6c 64 2d 74 61 67 73 (s:rebuild-tags
0ed0: 20 69 6e 70 75 74 2d 6c 69 73 74 29 0a 0a 3b 3b input-list)..;;
0ee0: 20 28 22 62 6c 61 68 20 62 6c 61 68 22 20 22 3c ("blah blah" "<
0ef0: 22 20 22 62 22 20 22 3e 22 20 22 6d 6f 72 65 20 " "b" ">" "more
0f00: 73 74 75 66 66 22 20 22 3c 22 20 22 69 22 20 22 stuff" "<" "i" "
0f10: 3e 22 20 29 20 0a 3b 3b 20 20 20 20 20 3d 3e 20 >" ) .;; =>
0f20: 28 22 62 6c 61 68 20 62 6c 61 68 22 20 62 20 23 ("blah blah" b #
0f30: 74 20 28 20 22 6d 6f 72 65 20 73 74 75 66 66 22 t ( "more stuff"
0f40: 20 22 3c 22 20 22 69 22 20 22 3e 22 20 29 29 0a "<" "i" ">" )).
0f50: 3b 3b 20 28 22 62 6c 61 68 20 62 6c 61 68 22 20 ;; ("blah blah"
0f60: 22 3c 22 20 22 2f 62 22 20 22 3e 22 20 22 6d 6f "<" "/b" ">" "mo
0f70: 72 65 20 73 74 75 66 66 22 20 22 3c 22 20 22 69 re stuff" "<" "i
0f80: 22 20 22 3e 22 20 29 20 0a 3b 3b 20 20 20 20 20 " ">" ) .;;
0f90: 3d 3e 20 28 22 62 6c 61 68 20 62 6c 61 68 22 20 => ("blah blah"
0fa0: 62 20 23 66 20 28 20 22 6d 6f 72 65 20 73 74 75 b #f ( "more stu
0fb0: 66 66 22 20 22 3c 22 20 22 69 22 20 22 3e 22 20 ff" "<" "i" ">"
0fc0: 29 29 0a 28 64 65 66 69 6e 65 20 28 73 3a 75 70 )).(define (s:up
0fd0: 74 6f 2d 74 61 67 20 69 6e 6c 73 74 20 61 6c 6c to-tag inlst all
0fe0: 6f 77 65 64 2d 74 61 67 73 29 0a 20 20 28 69 66 owed-tags). (if
0ff0: 20 28 6e 75 6c 6c 3f 20 69 6e 6c 73 74 29 20 69 (null? inlst) i
1000: 6e 6c 73 74 0a 20 20 20 20 20 20 28 6c 65 74 20 nlst. (let
1010: 6c 6f 6f 70 20 28 28 74 6f 6b 20 20 28 63 61 72 loop ((tok (car
1020: 20 69 6e 6c 73 74 29 29 0a 09 09 20 28 74 61 69 inlst))... (tai
1030: 6c 20 28 63 64 72 20 69 6e 6c 73 74 29 29 0a 09 l (cdr inlst))..
1040: 09 20 28 70 72 65 6c 20 22 22 29 29 20 3b 3b 20 . (prel "")) ;;
1050: 63 72 65 61 74 65 20 61 20 73 74 72 69 6e 67 20 create a string
1060: 6f 72 20 61 20 6c 69 73 74 20 6f 66 20 73 74 72 or a list of str
1070: 69 6e 67 20 70 61 72 74 73 3f 0a 09 28 69 66 20 ing parts?..(if
1080: 28 73 74 72 69 6e 67 3d 3f 20 74 6f 6b 20 22 3c (string=? tok "<
1090: 22 29 20 3b 3b 20 6d 69 67 68 74 20 68 61 76 65 ") ;; might have
10a0: 20 61 20 74 61 67 0a 09 20 20 20 20 28 69 66 20 a tag.. (if
10b0: 28 3e 20 28 6c 65 6e 67 74 68 20 74 61 69 6c 29 (> (length tail)
10c0: 20 31 29 20 3b 3b 20 74 6f 20 62 65 20 61 20 74 1) ;; to be a t
10d0: 61 67 2c 20 6e 65 65 64 20 74 61 67 20 61 6e 64 ag, need tag and
10e0: 20 63 6c 6f 73 69 6e 67 20 22 3e 22 0a 09 09 28 closing ">"...(
10f0: 6c 65 74 20 28 28 74 61 67 20 28 63 61 72 20 74 let ((tag (car t
1100: 61 69 6c 29 29 0a 09 09 20 20 20 20 20 20 28 65 ail))... (e
1110: 6e 64 20 28 63 61 64 72 20 74 61 69 6c 29 29 0a nd (cadr tail)).
1120: 09 09 20 20 20 20 20 20 28 72 65 6d 20 28 63 64 .. (rem (cd
1130: 64 72 20 74 61 69 6c 29 29 29 20 0a 09 09 20 20 dr tail))) ...
1140: 28 69 66 20 28 73 74 72 69 6e 67 3d 3f 20 65 6e (if (string=? en
1150: 64 20 22 3e 22 29 20 3b 3b 20 79 65 70 2c 20 69 d ">") ;; yep, i
1160: 74 20 69 73 20 70 72 6f 62 61 62 6c 79 20 61 20 t is probably a
1170: 74 61 67 0a 09 09 20 20 20 20 20 20 28 6c 65 74 tag... (let
1180: 2a 20 28 28 74 72 69 6d 2d 74 61 67 20 28 69 66 * ((trim-tag (if
1190: 20 20 28 73 74 72 69 6e 67 3d 3f 20 22 2f 22 20 (string=? "/"
11a0: 28 73 75 62 73 74 72 69 6e 67 20 74 61 67 20 30 (substring tag 0
11b0: 20 31 29 29 0a 09 09 09 09 09 20 20 20 20 28 73 1))...... (s
11c0: 75 62 73 74 72 69 6e 67 20 74 61 67 20 31 20 28 ubstring tag 1 (
11d0: 73 74 72 69 6e 67 2d 6c 65 6e 67 74 68 20 74 61 string-length ta
11e0: 67 29 29 20 23 66 29 29 0a 09 09 09 20 20 20 20 g)) #f))....
11f0: 20 28 74 61 67 2d 73 79 6d 20 20 28 73 74 72 69 (tag-sym (stri
1200: 6e 67 2d 3e 73 79 6d 62 6f 6c 20 28 69 66 20 74 ng->symbol (if t
1210: 72 69 6d 2d 74 61 67 20 74 72 69 6d 2d 74 61 67 rim-tag trim-tag
1220: 20 74 61 67 29 29 29 29 0a 09 09 09 28 69 66 20 tag))))....(if
1230: 28 6d 65 6d 62 65 72 20 74 61 67 2d 73 79 6d 20 (member tag-sym
1240: 61 6c 6c 6f 77 65 64 2d 74 61 67 73 29 0a 09 09 allowed-tags)...
1250: 09 20 20 20 20 3b 3b 20 68 61 76 65 20 61 20 76 . ;; have a v
1260: 61 6c 69 64 20 74 61 67 2c 20 72 65 62 75 69 6c alid tag, rebuil
1270: 64 20 69 74 20 61 6e 64 20 72 65 74 75 72 6e 20 d it and return
1280: 74 68 65 20 72 65 73 75 6c 74 0a 09 09 09 20 20 the result....
1290: 20 20 28 6c 69 73 74 20 70 72 65 6c 20 74 61 67 (list prel tag
12a0: 2d 73 79 6d 20 28 69 66 20 74 72 69 6d 2d 74 61 -sym (if trim-ta
12b0: 67 20 23 66 20 23 74 29 20 72 65 6d 29 0a 09 09 g #f #t) rem)...
12c0: 09 20 20 20 20 3b 3b 20 6e 6f 74 20 61 20 76 61 . ;; not a va
12d0: 6c 69 64 20 74 61 67 2c 20 63 6f 6e 76 65 72 74 lid tag, convert
12e0: 20 22 3c 22 20 61 6e 64 20 22 3e 22 20 61 6e 64 "<" and ">" and
12f0: 20 61 64 64 20 61 6c 6c 20 74 6f 20 70 72 65 6c add all to prel
1300: 0a 09 09 09 20 20 20 20 28 6c 65 74 20 28 28 6e .... (let ((n
1310: 65 77 70 72 65 6c 20 28 73 74 72 69 6e 67 2d 61 ewprel (string-a
1320: 70 70 65 6e 64 20 70 72 65 6c 20 22 26 6c 74 3b ppend prel "<
1330: 22 20 74 61 67 20 22 26 67 74 3b 22 29 29 29 0a " tag ">"))).
1340: 09 09 09 20 20 20 20 20 20 28 69 66 20 28 6e 75 ... (if (nu
1350: 6c 6c 3f 20 72 65 6d 29 28 6c 69 73 74 20 6e 65 ll? rem)(list ne
1360: 77 70 72 65 6c 20 23 66 20 23 66 20 27 28 29 29 wprel #f #f '())
1370: 20 3b 3b 20 72 65 74 75 72 6e 20 6e 65 77 70 72 ;; return newpr
1380: 65 6c 20 2d 20 61 64 64 20 23 66 20 23 66 20 3f el - add #f #f ?
1390: 3f 3f 0a 09 09 09 09 20 20 28 6c 6f 6f 70 20 28 ??..... (loop (
13a0: 63 61 72 20 72 65 6d 29 28 63 64 72 20 72 65 6d car rem)(cdr rem
13b0: 29 20 6e 65 77 70 72 65 6c 29 29 29 29 29 0a 09 ) newprel)))))..
13c0: 09 20 20 20 20 20 20 3b 3b 20 73 6f 2c 20 69 74 . ;; so, it
13d0: 20 77 61 73 6e 27 74 20 61 20 74 61 67 0a 09 09 wasn't a tag...
13e0: 20 20 20 20 20 20 28 6c 65 74 20 28 28 6e 65 77 (let ((new
13f0: 70 72 65 6c 20 28 73 74 72 69 6e 67 2d 61 70 70 prel (string-app
1400: 65 6e 64 20 70 72 65 6c 20 22 26 6c 74 3b 22 20 end prel "<"
1410: 74 61 67 29 29 29 0a 09 09 09 28 69 66 20 28 6e tag)))....(if (n
1420: 75 6c 6c 3f 20 74 61 69 6c 29 0a 09 09 09 20 20 ull? tail)....
1430: 20 20 28 6c 69 73 74 20 6e 65 77 70 72 65 6c 20 (list newprel
1440: 23 66 20 23 66 20 27 28 29 29 0a 09 09 09 20 20 #f #f '())....
1450: 20 20 28 6c 6f 6f 70 20 28 63 61 72 20 72 65 6d (loop (car rem
1460: 29 28 63 64 72 20 72 65 6d 29 20 6e 65 77 70 72 )(cdr rem) newpr
1470: 65 6c 29 29 29 29 29 0a 09 09 3b 3b 20 74 6f 6f el)))))...;; too
1480: 20 73 68 6f 72 74 20 74 6f 20 62 65 20 61 20 74 short to be a t
1490: 61 67 0a 09 09 28 6c 69 73 74 20 28 61 70 70 6c ag...(list (appl
14a0: 79 20 73 74 72 69 6e 67 2d 61 70 70 65 6e 64 20 y string-append
14b0: 70 72 65 6c 20 22 26 6c 74 3b 22 20 74 61 69 6c prel "<" tail
14c0: 29 20 23 66 20 23 66 20 27 28 29 29 29 0a 09 20 ) #f #f '()))..
14d0: 20 20 20 28 69 66 20 28 6e 75 6c 6c 3f 20 74 61 (if (null? ta
14e0: 69 6c 29 20 0a 09 09 3b 3b 20 77 65 27 72 65 20 il) ...;; we're
14f0: 64 6f 6e 65 0a 09 09 28 6c 69 73 74 20 28 73 74 done...(list (st
1500: 72 69 6e 67 2d 61 70 70 65 6e 64 20 70 72 65 6c ring-append prel
1510: 20 74 6f 6b 29 20 23 66 20 23 66 20 27 28 29 29 tok) #f #f '())
1520: 0a 09 09 28 6c 6f 6f 70 20 28 63 61 72 20 74 61 ...(loop (car ta
1530: 69 6c 29 28 63 64 72 20 74 61 69 6c 29 28 73 74 il)(cdr tail)(st
1540: 72 69 6e 67 2d 61 70 70 65 6e 64 20 70 72 65 6c ring-append prel
1550: 20 74 6f 6b 29 29 29 29 29 29 29 0a 0a 0a 28 64 tok)))))))...(d
1560: 65 66 69 6e 65 20 28 73 3a 64 69 76 79 2d 75 70 efine (s:divy-up
1570: 2d 63 67 69 2d 73 74 72 20 69 6e 73 74 72 29 0a -cgi-str instr).
1580: 20 20 28 6d 61 70 20 28 6c 61 6d 62 64 61 20 28 (map (lambda (
1590: 78 29 20 28 73 74 72 69 6e 67 2d 73 70 6c 69 74 x) (string-split
15a0: 20 78 20 22 3d 22 29 29 20 28 73 74 72 69 6e 67 x "=")) (string
15b0: 2d 73 70 6c 69 74 20 69 6e 73 74 72 20 22 26 22 -split instr "&"
15c0: 29 29 29 0a 0a 28 64 65 66 69 6e 65 20 28 73 3a )))..(define (s:
15d0: 64 65 63 6f 64 65 2d 73 74 72 20 69 6e 73 74 72 decode-str instr
15e0: 29 0a 20 20 28 6c 65 74 2a 20 28 28 61 62 63 20 ). (let* ((abc
15f0: 28 73 74 72 69 6e 67 2d 73 75 62 73 74 69 74 75 (string-substitu
1600: 74 65 20 22 5c 5c 2b 22 20 22 20 22 20 69 6e 73 te "\\+" " " ins
1610: 74 72 20 23 74 29 29 0a 09 20 28 74 6f 6b 73 20 tr #t)).. (toks
1620: 28 73 3a 73 70 6c 69 74 2d 73 74 72 69 6e 67 20 (s:split-string
1630: 61 62 63 20 22 25 22 29 29 29 0a 20 20 20 20 28 abc "%"))). (
1640: 69 66 20 28 3c 20 28 6c 65 6e 67 74 68 20 74 6f if (< (length to
1650: 6b 73 29 20 32 29 20 61 62 63 0a 09 28 6c 65 74 ks) 2) abc..(let
1660: 20 6c 6f 6f 70 20 28 28 68 65 61 64 20 28 63 61 loop ((head (ca
1670: 64 72 20 74 6f 6b 73 29 29 0a 09 09 20 20 20 28 dr toks))... (
1680: 74 61 69 6c 20 28 63 64 64 72 20 74 6f 6b 73 29 tail (cddr toks)
1690: 29 0a 09 09 20 20 20 28 72 65 73 75 6c 74 20 28 )... (result (
16a0: 63 61 72 20 74 6f 6b 73 29 29 29 0a 09 20 20 28 car toks))).. (
16b0: 69 66 20 28 73 74 72 69 6e 67 3d 3f 20 68 65 61 if (string=? hea
16c0: 64 20 22 22 29 0a 09 20 20 20 20 20 20 28 69 66 d "").. (if
16d0: 20 28 6e 75 6c 6c 3f 20 74 61 69 6c 29 0a 09 09 (null? tail)...
16e0: 20 20 72 65 73 75 6c 74 0a 09 09 20 20 28 6c 6f result... (lo
16f0: 6f 70 20 28 63 61 72 20 74 61 69 6c 29 28 63 64 op (car tail)(cd
1700: 72 20 74 61 69 6c 29 20 72 65 73 75 6c 74 29 29 r tail) result))
1710: 0a 09 20 20 20 20 20 20 28 6c 65 74 2a 20 28 28 .. (let* ((
1720: 6b 65 79 20 28 73 75 62 73 74 72 69 6e 67 20 68 key (substring h
1730: 65 61 64 20 30 20 32 29 29 0a 09 09 20 20 20 20 ead 0 2))...
1740: 20 28 72 65 6d 20 28 73 75 62 73 74 72 69 6e 67 (rem (substring
1750: 20 68 65 61 64 20 32 20 28 73 74 72 69 6e 67 2d head 2 (string-
1760: 6c 65 6e 67 74 68 20 68 65 61 64 29 29 29 0a 09 length head)))..
1770: 09 20 20 20 20 20 28 6e 75 6d 20 28 73 74 72 69 . (num (stri
1780: 6e 67 2d 3e 6e 75 6d 62 65 72 20 6b 65 79 20 31 ng->number key 1
1790: 36 29 29 0a 09 09 20 20 20 20 20 28 63 68 20 20 6))... (ch
17a0: 28 69 66 20 28 65 78 61 63 74 3f 20 6e 75 6d 29 (if (exact? num)
17b0: 0a 09 09 09 20 20 20 20 20 20 28 69 6e 74 65 67 .... (integ
17c0: 65 72 2d 3e 63 68 61 72 20 6e 75 6d 29 0a 09 09 er->char num)...
17d0: 09 20 20 20 20 20 20 23 66 29 29 20 3b 3b 20 74 . #f)) ;; t
17e0: 68 69 73 20 69 73 20 61 6e 20 65 72 72 6f 72 2e his is an error.
17f0: 20 49 20 77 69 6c 6c 20 70 72 6f 62 61 62 6c 79 I will probably
1800: 20 72 65 67 72 65 74 20 74 68 69 73 20 73 6f 6d regret this som
1810: 65 20 64 61 79 0a 09 09 20 20 20 20 20 28 63 68 e day... (ch
1820: 73 74 72 20 20 28 69 66 20 63 68 20 28 6d 61 6b str (if ch (mak
1830: 65 2d 73 74 72 69 6e 67 20 31 20 63 68 29 20 22 e-string 1 ch) "
1840: 22 29 29 0a 09 09 20 20 20 20 20 28 6e 65 77 72 "))... (newr
1850: 65 73 20 28 69 66 20 63 68 0a 09 09 09 09 20 28 es (if ch..... (
1860: 73 74 72 69 6e 67 2d 61 70 70 65 6e 64 20 72 65 string-append re
1870: 73 75 6c 74 20 63 68 73 74 72 20 72 65 6d 29 0a sult chstr rem).
1880: 09 09 09 09 20 28 73 74 72 69 6e 67 2d 61 70 70 .... (string-app
1890: 65 6e 64 20 72 65 73 75 6c 74 20 68 65 61 64 29 end result head)
18a0: 29 29 29 0a 09 09 3b 3b 20 28 70 72 69 6e 74 20 )))...;; (print
18b0: 22 68 65 61 64 3a 20 22 20 68 65 61 64 20 22 20 "head: " head "
18c0: 6e 75 6d 3a 20 22 20 6e 75 6d 20 22 20 63 68 3a num: " num " ch:
18d0: 20 7c 22 20 63 68 20 22 7c 20 63 68 73 74 72 3a |" ch "| chstr:
18e0: 20 22 20 63 68 73 74 72 29 0a 09 09 28 69 66 20 " chstr)...(if
18f0: 28 6e 75 6c 6c 3f 20 74 61 69 6c 29 0a 09 09 20 (null? tail)...
1900: 20 20 20 6e 65 77 72 65 73 0a 09 09 20 20 20 20 newres...
1910: 28 6c 6f 6f 70 20 28 63 61 72 20 74 61 69 6c 29 (loop (car tail)
1920: 28 63 64 72 20 74 61 69 6c 29 20 6e 65 77 72 65 (cdr tail) newre
1930: 73 29 29 29 29 29 29 29 29 0a 0a 28 64 65 66 69 s))))))))..(defi
1940: 6e 65 20 28 73 3a 70 72 6f 63 65 73 73 2d 63 67 ne (s:process-cg
1950: 69 2d 69 6e 70 75 74 20 69 6e 73 74 72 29 0a 20 i-input instr).
1960: 20 28 6d 61 70 20 28 6c 61 6d 62 64 61 20 28 78 (map (lambda (x
1970: 79 29 0a 20 20 20 20 20 20 20 20 20 28 6c 69 73 y). (lis
1980: 74 20 28 73 74 72 69 6e 67 2d 3e 73 79 6d 62 6f t (string->symbo
1990: 6c 20 28 73 3a 64 65 63 6f 64 65 2d 73 74 72 20 l (s:decode-str
19a0: 28 63 61 72 20 78 79 29 29 29 0a 20 20 20 20 20 (car xy))).
19b0: 20 20 20 20 20 20 20 20 20 20 28 69 66 20 28 65 (if (e
19c0: 71 3f 20 28 6c 65 6e 67 74 68 20 78 79 29 20 31 q? (length xy) 1
19d0: 29 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ) .
19e0: 20 20 20 20 20 20 22 22 0a 20 20 20 20 20 20 20 "".
19f0: 20 20 20 20 20 20 20 20 20 20 20 20 28 73 3a 64 (s:d
1a00: 65 63 6f 64 65 2d 73 74 72 20 28 63 61 64 72 20 ecode-str (cadr
1a10: 78 79 29 29 29 29 29 0a 20 20 20 20 20 20 20 20 xy))))).
1a20: 20 28 73 3a 64 69 76 79 2d 75 70 2d 63 67 69 2d (s:divy-up-cgi-
1a30: 73 74 72 20 69 6e 73 74 72 29 29 29 0a 0a 3b 3b str instr)))..;;
1a40: 20 66 6f 72 20 74 65 73 74 69 6e 67 20 2d 2d 20 for testing --
1a50: 64 65 6c 65 74 6d 65 0a 3b 3b 20 28 64 65 66 69 deletme.;; (defi
1a60: 6e 65 20 62 6c 61 68 20 22 70 6f 73 74 5f 74 69 ne blah "post_ti
1a70: 74 6c 65 3d 25 32 42 25 32 42 25 32 42 25 32 42 tle=%2B%2B%2B%2B
1a80: 25 32 42 25 32 42 25 32 42 25 32 42 25 32 42 25 %2B%2B%2B%2B%2B%
1a90: 32 42 25 32 42 68 65 6c 6c 6f 2d 2d 2d 2d 2d 2d 2B%2Bhello------
1aa0: 2d 2d 2d 2d 2d 2d 2d 2b 2b 2b 2b 2b 2b 2b 2b 2b -------+++++++++
1ab0: 2b 2b 25 32 36 25 32 36 25 32 36 25 32 36 25 32 ++%26%26%26%26%2
1ac0: 36 25 32 36 25 32 36 25 32 36 25 32 36 25 34 30 6%26%26%26%26%40
1ad0: 25 34 30 25 34 30 25 34 30 25 34 30 25 34 30 25 %40%40%40%40%40%
1ae0: 34 30 25 34 30 25 34 30 26 70 6f 73 74 5f 62 6f 40%40%40&post_bo
1af0: 64 79 3d 25 32 42 25 32 42 25 32 42 25 32 42 25 dy=%2B%2B%2B%2B%
1b00: 32 42 25 32 42 25 32 42 25 32 42 25 32 42 25 32 2B%2B%2B%2B%2B%2
1b10: 42 25 32 42 68 65 6c 6c 6f 2d 2d 2d 2d 2d 2d 2d B%2Bhello-------
1b20: 2d 2d 2d 2d 2d 2d 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b ------++++++++++
1b30: 2b 25 32 36 25 32 36 25 32 36 25 32 36 25 32 36 +%26%26%26%26%26
1b40: 25 32 36 25 32 36 25 32 36 25 32 36 25 34 30 25 %26%26%26%26%40%
1b50: 34 30 25 34 30 25 34 30 25 34 30 25 34 30 25 34 40%40%40%40%40%4
1b60: 30 25 34 30 25 34 30 25 30 44 25 30 41 25 30 44 0%40%40%0D%0A%0D
1b70: 25 30 41 25 32 42 25 32 42 25 32 42 25 32 42 25 %0A%2B%2B%2B%2B%
1b80: 32 42 25 32 42 25 32 42 25 32 42 25 32 42 25 32 2B%2B%2B%2B%2B%2
1b90: 42 25 32 42 68 65 6c 6c 6f 2d 2d 2d 2d 2d 2d 2d B%2Bhello-------
1ba0: 2d 2d 2d 2d 2d 2d 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b ------++++++++++
1bb0: 2b 25 32 36 25 32 36 25 32 36 25 32 36 25 32 36 +%26%26%26%26%26
1bc0: 25 32 36 25 32 36 25 32 36 25 32 36 25 34 30 25 %26%26%26%26%40%
1bd0: 34 30 25 34 30 25 34 30 25 34 30 25 34 30 25 34 40%40%40%40%40%4
1be0: 30 25 34 30 25 34 30 25 30 44 25 30 41 25 30 44 0%40%40%0D%0A%0D
1bf0: 25 30 41 25 30 44 25 30 41 25 32 42 25 32 42 25 %0A%0D%0A%2B%2B%
1c00: 32 42 25 32 42 25 32 42 25 32 42 25 32 42 25 32 2B%2B%2B%2B%2B%2
1c10: 42 25 32 42 25 32 42 25 32 42 68 65 6c 6c 6f 2d B%2B%2B%2Bhello-
1c20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2b 2b 2b ------------++++
1c30: 2b 2b 2b 2b 2b 2b 2b 25 32 36 25 32 36 25 32 36 +++++++%26%26%26
1c40: 25 32 36 25 32 36 25 32 36 25 32 36 25 32 36 25 %26%26%26%26%26%
1c50: 32 36 25 34 30 25 34 30 25 34 30 25 34 30 25 34 26%40%40%40%40%4
1c60: 30 25 34 30 25 34 30 25 34 30 25 34 30 26 6e 65 0%40%40%40%40&ne
1c70: 77 5f 70 6f 73 74 3d 53 75 62 6d 69 74 22 29 0a w_post=Submit").
1c80: 3b 3b 20 28 64 65 66 69 6e 65 20 62 6c 61 68 32 ;; (define blah2
1c90: 20 22 70 6f 73 74 5f 74 69 74 6c 65 3d 35 25 32 "post_title=5%2
1ca0: 35 26 70 6f 73 74 5f 62 6f 64 79 3d 61 6e 64 2b 5&post_body=and+
1cb0: 31 30 25 32 35 26 6e 65 77 5f 70 6f 73 74 3d 53 10%25&new_post=S
1cc0: 75 62 6d 69 74 22 29 ubmit")