--- /dev/null
+/*
+ * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
+ * Copyright (C) 2005 QSDN,Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __CHXJ_JRESERVED_TAG_H__
+#define __CHXJ_JRESERVED_TAG_H__
+
+#define CHXJ_SOFTBANK_RESERVED_TAG_PREFIX "_chxj_sf_"
+
+extern char *chxj_jreserved_to_safe_tag(request_rec *r, const char *src);
+extern char *chxj_safe_to_jreserved_tag(request_rec *r, const char *src);
+#endif
--- /dev/null
+<html>
+ <head>
+ <title>\83\\83t\83g\83o\83\93\83N\82Ì\97\\96ñ\83N\83G\83\8a\82Ì\83e\83X\83g</title>
+ </head>
+ <body>
+<?php
+echo "POSTDATA<br>";
+var_dump($_POST);
+echo "<hr>";
+echo "GETDATA<br>";
+var_dump($_GET);
+echo "<hr>";
+?>
+<hr>
+<form name="a" method="post" action="1.php">
+ <input type="text" name="pid" value="pid">
+ <input type="text" name="sid" value="sid">
+ <input type="text" name="uid" value="uid">
+ <input type="text" name="lid" value="lid">
+ <input type="text" name="gid" value="gid">
+ <input type="text" name="rpid" value="rpid">
+ <input type="text" name="rsid" value="rsid">
+ <input type="text" name="nl" value="nl">
+ <input type="text" name="cl" value="cl">
+ <input type="text" name="ol" value="ol">
+ <input type="text" name="pl" value="pl">
+ <input type="text" name="jskya" value="jskya">
+ <input type="text" name="prc" value="prc">
+ <input type="text" name="cnt" value="cnt">
+ <input type="text" name="reg" value="reg">
+ <input type="text" name="vsekey" value="vsekey">
+ <input type="text" name="vsernk" value="vsernk">
+ <input type="submit">
+</form>
+<hr>
+<form name="a" method="get" action="1.php">
+ <input type="text" name="pid" value="pid">
+ <input type="text" name="sid" value="sid">
+ <input type="text" name="uid" value="uid">
+ <input type="text" name="lid" value="lid">
+ <input type="text" name="gid" value="gid">
+ <input type="text" name="rpid" value="rpid">
+ <input type="text" name="rsid" value="rsid">
+ <input type="text" name="nl" value="nl">
+ <input type="text" name="cl" value="cl">
+ <input type="text" name="ol" value="ol">
+ <input type="text" name="pl" value="pl">
+ <input type="text" name="jskya" value="jskya">
+ <input type="text" name="prc" value="prc">
+ <input type="text" name="cnt" value="cnt">
+ <input type="text" name="reg" value="reg">
+ <input type="text" name="vsekey" value="vsekey">
+ <input type="text" name="vsernk" value="vsernk">
+ <input type="submit">
+</form>
+ </body>
+</html>
chxj_url_encode.c \
chxj_cookie.c \
chxj_preg_replace.c \
- chxj_emoji.c
+ chxj_emoji.c \
+ chxj_jreserved_tag.c
libmod_chxj_la_CFLAGS = $(AM_CFLAGS) -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include
libmod_chxj_la-chxj_url_encode.lo \
libmod_chxj_la-chxj_cookie.lo \
libmod_chxj_la-chxj_preg_replace.lo \
- libmod_chxj_la-chxj_emoji.lo
+ libmod_chxj_la-chxj_emoji.lo \
+ libmod_chxj_la-chxj_jreserved_tag.lo
libmod_chxj_la_OBJECTS = $(am_libmod_chxj_la_OBJECTS)
libmod_chxj_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libmod_chxj_la_CFLAGS) \
chxj_url_encode.c \
chxj_cookie.c \
chxj_preg_replace.c \
- chxj_emoji.c
+ chxj_emoji.c \
+ chxj_jreserved_tag.c
libmod_chxj_la_CFLAGS = $(AM_CFLAGS) -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include
AM_CFLAGS = @CFLAGS@ -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_img_conv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_img_conv_format.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_jhtml.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_jreserved_tag.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_load_device_data.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_load_emoji_data.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmod_chxj_la-chxj_node_convert.Plo@am__quote@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmod_chxj_la_CFLAGS) $(CFLAGS) -c -o libmod_chxj_la-chxj_emoji.lo `test -f 'chxj_emoji.c' || echo '$(srcdir)/'`chxj_emoji.c
+libmod_chxj_la-chxj_jreserved_tag.lo: chxj_jreserved_tag.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmod_chxj_la_CFLAGS) $(CFLAGS) -MT libmod_chxj_la-chxj_jreserved_tag.lo -MD -MP -MF $(DEPDIR)/libmod_chxj_la-chxj_jreserved_tag.Tpo -c -o libmod_chxj_la-chxj_jreserved_tag.lo `test -f 'chxj_jreserved_tag.c' || echo '$(srcdir)/'`chxj_jreserved_tag.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libmod_chxj_la-chxj_jreserved_tag.Tpo $(DEPDIR)/libmod_chxj_la-chxj_jreserved_tag.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='chxj_jreserved_tag.c' object='libmod_chxj_la-chxj_jreserved_tag.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmod_chxj_la_CFLAGS) $(CFLAGS) -c -o libmod_chxj_la-chxj_jreserved_tag.lo `test -f 'chxj_jreserved_tag.c' || echo '$(srcdir)/'`chxj_jreserved_tag.c
+
mostlyclean-libtool:
-rm -f *.lo
jhtml->out = apr_pstrcat(r->pool,
jhtml->out,
" name=\"",
- name,
+ chxj_jreserved_to_safe_tag(r, name),
"\" ",
NULL);
}
value = qs_get_attr_value(doc,attr);
if ((*name == 'n' || *name == 'N') && strcasecmp(name, "name") == 0) {
- jhtml->out = apr_pstrcat(r->pool, jhtml->out, " name=\"",value,"\"", NULL);
+ jhtml->out = apr_pstrcat(r->pool, jhtml->out, " name=\"",chxj_jreserved_to_safe_tag(r, value),"\"", NULL);
}
else
if ((*name == 'r' || *name == 'R') && strcasecmp(name, "rows") == 0) {
--- /dev/null
+/*
+ * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
+ * Copyright (C) 2005 QSDN,Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "mod_chxj.h"
+#include "chxj_jreserved_tag.h"
+
+typedef struct r_table {
+ char lower;
+ char upper;
+ char *name;
+} r_table_t;
+
+static r_table_t reserved_start_with_table[] = {
+ {
+ .lower = 'j',
+ .upper = 'J',
+ .name = "jsky",
+ },
+};
+
+
+#define RESERVED_NELT (16)
+#define RESERVED_NELT_START_WITH (1)
+
+static r_table_t reserved_table[] = {
+ {
+ .lower = 'p',
+ .upper = 'P',
+ .name = "pid",
+ },
+ {
+ .lower = 's',
+ .upper = 'S',
+ .name = "sid",
+ },
+ {
+ .lower = 'u',
+ .upper = 'U',
+ .name = "uid",
+ },
+ {
+ .lower = 'l',
+ .upper = 'L',
+ .name = "lid",
+ },
+ {
+ .lower = 'g',
+ .upper = 'G',
+ .name = "gid",
+ },
+ {
+ .lower = 'r',
+ .upper = 'R',
+ .name = "rpid",
+ },
+ {
+ .lower = 'r',
+ .upper = 'R',
+ .name = "rsid",
+ },
+ {
+ .lower = 'n',
+ .upper = 'N',
+ .name = "nl",
+ },
+ {
+ .lower = 'c',
+ .upper = 'C',
+ .name = "cl",
+ },
+ {
+ .lower = 'o',
+ .upper = 'O',
+ .name = "ol",
+ },
+ {
+ .lower = 'p',
+ .upper = 'P',
+ .name = "pl",
+ },
+ {
+ .lower = 'p',
+ .upper = 'P',
+ .name = "prc",
+ },
+ {
+ .lower = 'c',
+ .upper = 'C',
+ .name = "cnt",
+ },
+ {
+ .lower = 'r',
+ .upper = 'R',
+ .name = "reg",
+ },
+ {
+ .lower = 'v',
+ .upper = 'V',
+ .name = "vsekey",
+ },
+ {
+ .lower = 'v',
+ .upper = 'V',
+ .name = "vsernk",
+ },
+};
+
+
+char *
+chxj_jreserved_to_safe_tag(request_rec *r, const char *src)
+{
+ int ii;
+ for (ii=0;ii<RESERVED_NELT;ii++) {
+ if (STRCASEEQ(reserved_table[ii].lower,
+ reserved_table[ii].upper,
+ reserved_table[ii].name,
+ src)) {
+ return apr_psprintf(r->pool, "%s%s", CHXJ_SOFTBANK_RESERVED_TAG_PREFIX, reserved_table[ii].name);
+ }
+ }
+ for (ii=0; ii<RESERVED_NELT_START_WITH; ii++) {
+ if (strncasecmp(reserved_start_with_table[ii].name, src, sizeof(reserved_start_with_table[ii].name)) == 0) {
+ return apr_psprintf(r->pool, "%s%s", CHXJ_SOFTBANK_RESERVED_TAG_PREFIX, src);
+ }
+ }
+ return (char *)src;
+}
+
+
+char *
+chxj_safe_to_jreserved_tag(request_rec *r, const char *src)
+{
+ if (strncasecmp(CHXJ_SOFTBANK_RESERVED_TAG_PREFIX, src, sizeof(CHXJ_SOFTBANK_RESERVED_TAG_PREFIX)-1) == 0) {
+ return apr_pstrdup(r->pool, &src[sizeof(CHXJ_SOFTBANK_RESERVED_TAG_PREFIX)-1]);
+ }
+ return (char *)src;
+}
#include "chxj_url_encode.h"
#include "chxj_str_util.h"
#include "chxj_emoji.h"
+#include "chxj_jreserved_tag.h"
#define CHXJ_VERSION_PREFIX PACKAGE_NAME "/"
name = apr_strtok(pair, "=", &vstate);
value = apr_strtok(NULL, "=", &vstate);
+ name = chxj_safe_to_jreserved_tag(r, name);
+
if (strncasecmp(name, "_chxj", 5) != 0) {
if (strlen(result) != 0)
result = apr_pstrcat(r->pool, result, "&", NULL);
name = apr_strtok(pair, "=", &vstate);
value = apr_strtok(NULL, "=", &vstate);
+ name = chxj_safe_to_jreserved_tag(r, name);
+
if (strncasecmp(name, "_chxj", 5) != 0) {
result = chxj_convert_emoji_param_list(r, spec, entryp, result, name, value, func_emoji_to_meta_emoji);
DBG(r, "result:[%s]", result);