OSDN Git Service

* Fixed bug.
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Fri, 27 Jun 2008 07:39:46 +0000 (07:39 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Fri, 27 Jun 2008 07:39:46 +0000 (07:39 +0000)
    - The bug that was not able to be displayed correctly when a double quart
      was included in value.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_12_0@2746 1a406e8e-add9-4483-a2c8-d8cac5b7c224

17 files changed:
ChangeLog
configure
configure.ac
debian-sarge/changelog
debian/changelog
include/chxj_str_util.h
include/config.h
src/chxj_chtml10.c
src/chxj_chtml20.c
src/chxj_chtml30.c
src/chxj_chtml40.c
src/chxj_chtml50.c
src/chxj_jhtml.c
src/chxj_jxhtml.c
src/chxj_str_util.c
src/chxj_xhtml_mobile_1_0.c
src/mod_chxj.c

index faf9596..59b5406 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+libapache2-mod-chxj (0.12.5-1) unstable; urgency=low
+
+  * Fixed bug.
+    - The bug that was not able to be displayed correctly when a double quart
+      was included in value.
+
+ -- Atsushi Konno <konn@users.sourceforge.jp>  Fri, 27 Jun 2008 16:37:26 +0900
+
 libapache2-mod-chxj (0.12.4-1) unstable; urgency=low
 
   * Fixed Bug.
index b34a1d4..24ed39f 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for mod_chxj 0.12.4-1.
+# Generated by GNU Autoconf 2.61 for mod_chxj 0.12.5-1.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='mod_chxj'
 PACKAGE_TARNAME='mod_chxj'
-PACKAGE_VERSION='0.12.4-1'
-PACKAGE_STRING='mod_chxj 0.12.4-1'
+PACKAGE_VERSION='0.12.5-1'
+PACKAGE_STRING='mod_chxj 0.12.5-1'
 PACKAGE_BUGREPORT=''
 
 ac_unique_file="src/mod_chxj.c"
@@ -1405,7 +1405,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures mod_chxj 0.12.4-1 to adapt to many kinds of systems.
+\`configure' configures mod_chxj 0.12.5-1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1476,7 +1476,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mod_chxj 0.12.4-1:";;
+     short | recursive ) echo "Configuration of mod_chxj 0.12.5-1:";;
    esac
   cat <<\_ACEOF
 
@@ -1592,7 +1592,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mod_chxj configure 0.12.4-1
+mod_chxj configure 0.12.5-1
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1606,7 +1606,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mod_chxj $as_me 0.12.4-1, which was
+It was created by mod_chxj $as_me 0.12.5-1, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2424,7 +2424,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=mod_chxj
- VERSION=0.12.4-1
+ VERSION=0.12.5-1
 
 
 cat >>confdefs.h <<_ACEOF
@@ -21835,7 +21835,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mod_chxj $as_me 0.12.4-1, which was
+This file was extended by mod_chxj $as_me 0.12.5-1, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21888,7 +21888,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-mod_chxj config.status 0.12.4-1
+mod_chxj config.status 0.12.5-1
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
index ccc2664..4a14e43 100644 (file)
@@ -1,6 +1,6 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
-AC_INIT([mod_chxj],[0.12.4-1])
+AC_INIT([mod_chxj],[0.12.5-1])
 AC_PREREQ(2.59)
 AC_CONFIG_SRCDIR([src/mod_chxj.c])
 AC_CANONICAL_TARGET
index b6ac1eb..d825bca 100644 (file)
@@ -1,3 +1,11 @@
+libapache2-mod-chxj (0.12.5-1) unstable; urgency=low
+
+  * Fixed bug.
+    - The bug that was not able to be displayed correctly when a double quart
+      was included in value.
+
+ -- Atsushi Konno <konn@users.sourceforge.jp>  Fri, 27 Jun 2008 16:37:26 +0900
+
 libapache2-mod-chxj (0.12.4-1) unstable; urgency=low
 
   * Fixed Bug.
index 9c44ec2..1df315f 100644 (file)
@@ -1,3 +1,11 @@
+libapache2-mod-chxj (0.12.5-1) unstable; urgency=low
+
+  * Fixed bug.
+    - The bug that was not able to be displayed correctly when a double quart
+      was included in value.
+
+ -- Atsushi Konno <konn@users.sourceforge.jp>  Fri, 27 Jun 2008 16:37:26 +0900
+
 libapache2-mod-chxj (0.12.4-1) unstable; urgency=low
 
   * Fixed Bug.
index 85e5627..2f8458c 100644 (file)
@@ -28,6 +28,7 @@ extern int chxj_atoi(
 
 extern int chxj_strcasenrcmp(apr_pool_t *p, const char *s1, const char *s2, int n);
 extern int chxj_starts_with(const char *str, const char *word);
+extern char *chxj_add_slash_to_doublequote(apr_pool_t *pool, const char *str);
 #endif
 /*
  * vim:ts=2 et
index f6acff7..28d9f22 100644 (file)
 #define PACKAGE_NAME "mod_chxj"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "mod_chxj 0.12.4-1"
+#define PACKAGE_STRING "mod_chxj 0.12.5-1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "mod_chxj"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "0.12.4-1"
+#define PACKAGE_VERSION "0.12.5-1"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION "0.12.4-1"
+#define VERSION "0.12.5-1"
 
 /* Define to empty if `const' does not conform to ANSI C. */
 /* #undef const */
index c96726d..b1fe6a6 100644 (file)
@@ -1967,7 +1967,7 @@ s_chtml10_start_input_tag(void *pdoc, Node *node)
 
   if (value && *value != 0) {
     W_L(" value=\"");
-    W_V(value);
+    W_V(chxj_add_slash_to_doublequote(doc->pool, value));
     W_L("\"");
   }
 
index 2f75492..36f1a77 100644 (file)
@@ -1584,7 +1584,7 @@ s_chtml20_start_input_tag(void *pdoc, Node *node)
   }
   if (value && *value) {
     W_L(" value=\"");
-    W_V(value);
+    W_V(chxj_add_slash_to_doublequote(doc->pool, value));
     W_L("\"");
   }
   if (accesskey && *accesskey) {
index e1812d6..44967f7 100644 (file)
@@ -1434,7 +1434,7 @@ s_chtml30_start_input_tag(void *pdoc, Node *node)
   }
   if (value && *value) {
     W_L(" value=\"");
-    W_V(value);
+    W_V(chxj_add_slash_to_doublequote(doc->pool, value));
     W_L("\"");
   }
   if (accesskey && *accesskey) {
index 43c9c2e..e33bc72 100644 (file)
@@ -1441,7 +1441,7 @@ s_chtml40_start_input_tag(void *pdoc, Node *node)
   }
   if (value && *value) {
     W_L(" value=\"");
-    W_V(value);
+    W_V(chxj_add_slash_to_doublequote(doc->pool, value));
     W_L("\"");
   }
   if (accesskey && *accesskey) {
index 53b1da5..51e14b8 100644 (file)
@@ -1481,7 +1481,7 @@ s_chtml50_start_input_tag(void *pdoc, Node *node)
   }
   if (value && *value) {
     W_L(" value=\"");
-    W_V(value);
+    W_V(chxj_add_slash_to_doublequote(doc->pool, value));
     W_L("\"");
   }
   if (accesskey && *accesskey) {
index f12aef7..a8e9e85 100644 (file)
@@ -1485,7 +1485,7 @@ s_jhtml_start_input_tag(void *pdoc, Node *node)
   }
   if (value && *value) {
     W_L(" value=\"");
-    W_V(value);
+    W_V(chxj_add_slash_to_doublequote(doc->pool, value));
     W_L("\"");
   }
   if (accesskey && *accesskey) {
index d360114..85743d3 100644 (file)
@@ -1539,7 +1539,7 @@ s_jxhtml_start_input_tag(void *pdoc, Node *node)
   }
   if (value && *value) {
     W_L(" value=\"");
-    W_V(value);
+    W_V(chxj_add_slash_to_doublequote(doc->pool, value));
     W_L("\"");
   }
   if (accesskey && *accesskey) {
index 6e56605..611d3d5 100644 (file)
@@ -159,6 +159,40 @@ chxj_starts_with(const char *str, const char *word)
   if (len == 0) len = 1;
   return strncasecmp(s, w, len) == 0;
 }
+
+
+char *
+chxj_add_slash_to_doublequote(apr_pool_t *pool, const char *str)
+{
+  char *ret;
+  int  len;
+  int  tlen;
+  int  ii;
+  int  pos;
+  int  cnt;
+
+  len = strlen(str);
+  cnt = 0;
+  for (ii=0; ii<len; ii++) {
+    if (str[ii] == '"') {
+      cnt++;
+    }
+  }
+  tlen = (len - cnt)  + (cnt * (sizeof("&quot;")-1)) + 1;
+  ret = apr_palloc(pool, tlen);
+  memset(ret, 0, tlen);
+  pos = 0;
+  for (ii=0; ii<len; ii++) {
+    if (str[ii] == '"') {
+      strcpy(&ret[pos], "&quot;");
+      pos += sizeof("&quot;")-1;
+    }
+    else {
+      ret[pos++] = str[ii];
+    }
+  }
+  return ret;
+}
 /*
  * vim:ts=2 et
  */
index 37a0041..27de646 100644 (file)
@@ -1428,7 +1428,7 @@ s_xhtml_1_0_start_input_tag(void *pdoc, Node *node)
   }
   if (value && *value) {
     W_L(" value=\"");
-    W_V(value);
+    W_V(chxj_add_slash_to_doublequote(doc->pool, value));
     W_L("\"");
   }
   if (accesskey && *accesskey) {
index b279b6c..1a55479 100644 (file)
@@ -450,20 +450,36 @@ chxj_convert_input_header(request_rec *r,chxjconvrule_entry *entryp)
       if (strlen(result) != 0) 
         result = apr_pstrcat(r->pool, result, "&", NULL);
 
-      if (strcasecmp(entryp->encoding, "NONE") != 0 && value && strlen(value)) {
+      if (strcasecmp(entryp->encoding, "NONE") != 0) {
         apr_size_t dlen;
         char *dvalue;
+        char *dname;
 
-        dlen   = strlen(value);
-        value = chxj_url_decode(r->pool, value);
-        DBG(r, "************ before encoding[%s]", value);
-
-        dvalue = chxj_rencoding(r, value, &dlen);
-        dvalue = chxj_url_encode(r->pool, dvalue);
+        if (value && *value != 0) {
+          value = chxj_url_decode(r->pool, value);
+          dlen   = strlen(value);
+          DBG(r, "************ before encoding[%s]", value);
+  
+          dvalue = chxj_rencoding(r, value, &dlen);
+          dvalue = chxj_url_encode(r->pool, dvalue);
+  
+          DBG(r, "************ after encoding[%s]", dvalue);
+        }
+        else {
+          dvalue = "";
+        }
 
-        DBG(r, "************ after encoding[%s]", dvalue);
+        if (name && *name != 0) {
+          name = chxj_url_decode(r->pool, name);
+          dlen = strlen(name);
+          dname = chxj_rencoding(r, name, &dlen);
+          dname = chxj_url_encode(r->pool, dname);
+        }
+        else {
+          dname = "";
+        }
 
-        result = apr_pstrcat(r->pool, result, name, "=", dvalue, NULL);
+        result = apr_pstrcat(r->pool, result, dname, "=", dvalue, NULL);
       }
       else {
         if (strcmp(name, pair_sv) != 0)
@@ -575,22 +591,36 @@ chxj_input_convert(
       if (strlen(result) != 0) 
         result = apr_pstrcat(r->pool, result, "&", NULL);
 
-      if (strcasecmp(entryp->encoding, "NONE") != 0 
-      &&  value && strlen(value)) {
+      if (strcasecmp(entryp->encoding, "NONE") != 0) {
         apr_size_t dlen;
-        char       *dvalue;
+        char *dvalue;
+        char *dname;
 
-        dlen   = strlen(value);
-        value = chxj_url_decode(r->pool, value);
-        DBG(r, "************ before encoding[%s]", value);
+        if (value && *value != 0) {
+          value = chxj_url_decode(r->pool, value);
+          dlen   = strlen(value);
+          DBG(r, "************ before encoding[%s]", value);
 
-        dvalue = chxj_rencoding(r, value, &dlen);
-        dvalue = chxj_url_encode(r->pool,dvalue);
+          dvalue = chxj_rencoding(r, value, &dlen);
+          dvalue = chxj_url_encode(r->pool, dvalue);
 
-        DBG(r, "************ after encoding[%s]", dvalue);
+          DBG(r, "************ after encoding[%s]", dvalue);
+        }
+        else {
+          dvalue = "";
+        }
 
-        result = apr_pstrcat(r->pool, result, name, "=", dvalue, NULL);
+        if (name && *name != 0) {
+          name = chxj_url_decode(r->pool, name);
+          dlen = strlen(name);
+          dname = chxj_rencoding(r, name, &dlen);
+          dname = chxj_url_encode(r->pool, dname);
+        }
+        else {
+          dname = "";
+        }
 
+        result = apr_pstrcat(r->pool, result, dname, "=", dvalue, NULL);
       }
       else {
         result = apr_pstrcat(r->pool, result, name, "=", value, NULL);