From 5a98249634e8c85ca4a84d47d35204847440125b Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 1 Feb 2004 12:21:41 +0000 Subject: [PATCH] r8587: add uri query function --- package.lisp | 1 + web-utils.lisp | 10 ++++++++++ 2 files changed, 11 insertions(+) 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 #\&))) -- 2.34.1