summaryrefslogtreecommitdiffabout
path: root/src
Side-by-side diff
Diffstat (limited to 'src') (more/less context) (show whitespace changes)
-rw-r--r--src/cgi-bin/conj.scm49
-rw-r--r--src/cgi-bin/dict.scm428
-rw-r--r--src/cgi-bin/nea.scm422
-rw-r--r--src/ellinika/cgi.scm425
-rw-r--r--src/ellinika/i18n.scm6
5 files changed, 55 insertions, 35 deletions
diff --git a/src/cgi-bin/conj.scm4 b/src/cgi-bin/conj.scm4
index 83fb846..6a49c62 100644
--- a/src/cgi-bin/conj.scm4
+++ b/src/cgi-bin/conj.scm4
@@ -1,3 +1,3 @@
;;;; Greek Dictionary Web Engine
-;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011 Sergey Poznyakoff
+;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011, 2015 Sergey Poznyakoff
;;;;
@@ -20,2 +20,3 @@
+(setlocale LC_ALL "")
(use-modules ifelse(IFACE,[CGI],(www cgi),(guile-user))
@@ -63,3 +64,3 @@ ifelse(IFACE,[CGI],(cgi:init))
<input size=\"36\" name=\"key\" tabindex=\"1\"")
- (let ((value (cgi:value "key")))
+ (let ((value (cgi:value-u8 "key")))
(if value
@@ -352,3 +353,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(define (do-conj)
- (let ((keyval (cgi:value "key")))
+ (let ((keyval (cgi:value-u8 "key")))
(if (and keyval (not (string-null? keyval)))
@@ -402,3 +403,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(else
- (let ((v (cgi:value name)))
+ (let ((v (cgi:value-u8 name)))
(cond ((and v (not (string-null? v)))
diff --git a/src/cgi-bin/dict.scm4 b/src/cgi-bin/dict.scm4
index 77c1b3a..3b24367 100644
--- a/src/cgi-bin/dict.scm4
+++ b/src/cgi-bin/dict.scm4
@@ -1,3 +1,3 @@
;;;; Greek Dictionary Web Engine
-;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011 Sergey Poznyakoff
+;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011, 2015 Sergey Poznyakoff
;;;;
@@ -20,2 +20,4 @@
+(setlocale LC_ALL "")
+
(use-modules ifelse(IFACE,[CGI],(www cgi),(guile-user))
@@ -24,2 +26,3 @@
(gamma sql)
+ (gamma syslog)
(ellinika elmorph)
@@ -81,3 +84,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(let* ((name (string-append "join" widget-id))
- (selected-choice (or (let ((s (cgi:value name)))
+ (selected-choice (or (let ((s (cgi:value-u8 name)))
(if s
@@ -114,3 +117,3 @@ ifelse(IFACE,[CGI],(cgi:init))
<input size=\"36\" name=\"key\" tabindex=\"1\"")
- (let ((value (cgi:value "key")))
+ (let ((value (cgi:value-u8 "key")))
(if value
@@ -134,3 +137,3 @@ ifelse(IFACE,[CGI],(cgi:init))
- (let ((selected-choice (or (let ((s (cgi:value "pos")))
+ (let ((selected-choice (or (let ((s (cgi:value-u8 "pos")))
(if s
@@ -168,3 +171,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(display "</td><td>")
- (let ((selected-choice (or (let ((s (cgi:value (list-ref category 0))))
+ (let ((selected-choice (or (let ((s (cgi:value-u8 (list-ref category 0))))
(if s
@@ -355,3 +358,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(set! where-cond (cons
- (if (string=? (cgi:value "joinpos") "0")
+ (if (string=? (cgi:value-u8 "joinpos") "0")
" AND"
@@ -420,5 +423,4 @@ ifelse(IFACE,[CGI],(cgi:init))
(define (dict-search)
- (let ((keyval (if (cgi:value "ident")
- (dict:decode-string (cgi:value "ident"))
- (cgi:value "key")))
+ (let ((keyval (or (cgi:value-u8 "ident")
+ (cgi:value-u8 "key")))
(theme (do ((catlist (get-topic-list) (cdr catlist))
@@ -427,3 +429,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(let ((name (caar catlist)))
- (let ((v (cgi:value name)))
+ (let ((v (cgi:value-u8 name)))
(if (and v (> (string->number v) 0))
@@ -432,5 +434,5 @@ ifelse(IFACE,[CGI],(cgi:init))
(list (= (string->number
- (cgi:value (string-append "join" name))) 0)
+ (cgi:value-u8 (string-append "join" name))) 0)
v))))))))
- (pos (or (cgi:value "pos") "0")))
+ (pos (or (cgi:value-u8 "pos") "0")))
@@ -523,3 +525,3 @@ dict.forms,articles.subindex,articles.meaning,(dict.pos & conv(\"100000\",16,10)
(else
- (let ((v (cgi:value name)))
+ (let ((v (cgi:value-u8 name)))
(cond ((and v (not (string-null? v)))
diff --git a/src/cgi-bin/nea.scm4 b/src/cgi-bin/nea.scm4
index f64aca2..e366a7c 100644
--- a/src/cgi-bin/nea.scm4
+++ b/src/cgi-bin/nea.scm4
@@ -1,3 +1,3 @@
;;;; News page for Ellinika
-;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011 Sergey Poznyakoff
+;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011, 2015 Sergey Poznyakoff
;;;;
@@ -32,3 +32,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(define tmpl (if (and monima-nea-template-file-name
- (cgi:value "timestamp"))
+ (cgi:value-u8 "timestamp"))
monima-nea-template-file-name
@@ -179,3 +179,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(lambda ()
- (let ((x (string->number (cgi:value "from"))))
+ (let ((x (string->number (cgi:value-u8 "from"))))
(if (< x count)
@@ -185,3 +185,3 @@ ifelse(IFACE,[CGI],(cgi:init))
0)))
- (fwd (let ((dir (cgi:value "dir")))
+ (fwd (let ((dir (cgi:value-u8 "dir")))
(or (not dir)
@@ -201,3 +201,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(end (if fwd start from))
- (id (cgi:value "id")))
+ (id (cgi:value-u8 "id")))
@@ -275,3 +275,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(display "</span>")
- (if (not (cgi:value "timestamp"))
+ (if (not (cgi:value-u8 "timestamp"))
(permalink "span" (list-ref item 1)))
@@ -339,3 +339,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(else
- (let ((v (cgi:value name)))
+ (let ((v (cgi:value-u8 name)))
(cond ((and v (not (string-null? v)))
@@ -437,3 +437,3 @@ ifelse(IFACE,[CGI],(cgi:init))
(cond
- ((cgi:value "rss")
+ ((cgi:value-u8 "rss")
ifelse(IFACE,[CGI],
@@ -449,6 +449,6 @@ ifelse(IFACE,[CGI],(cgi:init))
(cond
- ((or (cgi:value "timestamp") (cgi:value "id"))
+ ((or (cgi:value-u8 "timestamp") (cgi:value-u8 "id"))
(let ((tuples
(cond
- ((cgi:value "timestamp") =>
+ ((cgi:value-u8 "timestamp") =>
(lambda (ts)
@@ -457,3 +457,3 @@ ifelse(IFACE,[CGI],(cgi:init))
FROM news WHERE unix_timestamp(date)=~Q" ts)))
- ((cgi:value "id") =>
+ ((cgi:value-u8 "id") =>
(lambda (id)
diff --git a/src/ellinika/cgi.scm4 b/src/ellinika/cgi.scm4
index 8c9b54d..51f9570 100644
--- a/src/ellinika/cgi.scm4
+++ b/src/ellinika/cgi.scm4
@@ -1,4 +1,3 @@
-;;;; -*- scheme -*-
-;;;; Greek Dictionary Web Engine
-;;;; Copyright (C) 2005, 2007, 2010 Sergey Poznyakoff
+;;;; Greek Dictionary Web Engine -*- scheme -*-
+;;;; Copyright (C) 2005, 2007, 2010, 2015 Sergey Poznyakoff
;;;;
@@ -21,2 +20,4 @@
#:use-module ifelse(IFACE,[CGI],(www cgi),(guile-user))
+ #:use-module (ice-9 iconv)
+ #:use-module (rnrs bytevectors)
#:re-export (base-dir html-dir sysconf-dir locale-path
@@ -26,3 +27,17 @@
-ifelse(IFACE,[CGI],,dnl
+ifelse(IFACE,[CGI],[
+(define-public cgi-script-name
+ (cgi:getenv 'script-name))
+(define-public cgi-server-hostname
+ (cgi:getenv 'server-hostname))
+(define-public cgi-server-protocol-name
+ (cgi:getenv 'server-protocol-name))
+(define-public cgi-server-protocol-version
+ (cgi:getenv 'server-protocol-version))
+(define-public (cgi:value-u8 key)
+ (let ((x (cgi:value key)))
+ (if x
+ (utf8->string (string->bytevector x "ISO-8859-1"))
+ x)))
+],[
(define form-data
@@ -61,3 +76,3 @@ ifelse(IFACE,[CGI],,dnl
-)
+])
diff --git a/src/ellinika/i18n.scm b/src/ellinika/i18n.scm
index c05d727..40cb47d 100644
--- a/src/ellinika/i18n.scm
+++ b/src/ellinika/i18n.scm
@@ -1,3 +1,3 @@
;;;; This file is part of Greek Dictionary Web Engine
-;;;; Copyright (C) 2006, 2007 Sergey Poznyakoff
+;;;; Copyright (C) 2006, 2007, 2015 Sergey Poznyakoff
;;;;
@@ -17,3 +17,2 @@
(define-module (ellinika i18n)
- #:use-syntax (ice-9 syncase)
#:export-syntax (_)
@@ -21,2 +20,5 @@
+(if (= (string->number (major-version)) 1)
+ (use-modules (ice-9 syncase)))
+
(define-syntax _

Return to:

Send suggestions and report system problems to the System administrator.