X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=web-utils.lisp;h=40cb04018bed71dfd1883a0c09880261a7eda2f3;hp=56afffdd2d3bdc055f2c5221e2a1e215cc5c71e6;hb=baaf50bd67cbb36d51bfaf0b473cc914d140a41b;hpb=72b483ebb9fd0f02acb1b20ef14ee8bac845eca8 diff --git a/web-utils.lisp b/web-utils.lisp index 56afffd..40cb040 100644 --- a/web-utils.lisp +++ b/web-utils.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: web-utils.lisp,v 1.12 2003/06/12 11:10:38 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -27,7 +27,7 @@ (defvar *standard-html-header* "") (defvar *standard-xhtml-header* - #.(format nil "~%")) + #.(format nil "~%")) ;;; User agent functions @@ -36,6 +36,7 @@ "Takes a user-agent string and returns T for Internet Explorer." (or (string-starts-with "Microsoft" agent) (string-starts-with "Internet Explore" agent) + (search "Safari" agent) (search "MSIE" agent))) ;;; URL Functions @@ -88,7 +89,7 @@ (declare (simple-string s) (optimize (speed 3) (safety 0) (space 0))) (do* ((old-len (length s)) - (new-len (- old-len (* 2 (count-string-char s #\%)))) + (new-len (- old-len (* 2 (the fixnum (count-string-char s #\%))))) (new (make-string new-len)) (p-old 0) (p-new 0 (1+ p-new))) @@ -110,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 #\&)))