From: Kevin M. Rosenberg Date: Sun, 1 Feb 2004 12:21:41 +0000 (+0000) Subject: r8587: add uri query function X-Git-Tag: v1.96~90 X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=commitdiff_plain;h=5a98249634e8c85ca4a84d47d35204847440125b r8587: add uri query function --- diff --git a/package.lisp b/package.lisp index 62bf637..8e2e516 100644 --- a/package.lisp +++ b/package.lisp @@ -216,6 +216,7 @@ #:*standard-xml-header* #:user-agent-ie-p #:decode-uri-query-string + #:split-uri-query-string ;; From xml-utils #:sgml-header-stream diff --git a/web-utils.lisp b/web-utils.lisp index 35611eb..40cb040 100644 --- a/web-utils.lisp +++ b/web-utils.lisp @@ -111,3 +111,13 @@ (t (setf (schar new p-new) c) (incf p-old)))))) + +(defun split-uri-query-string (s) + (mapcar + (lambda (pair) + (let ((pos (position #\= pair))) + (when pos + (cons (subseq pair 0 pos) + (when (> (length pair) pos) + (decode-uri-query-string (subseq pair (1+ pos)))))))) + (delimited-string-to-list s #\&)))