extern int chxj_chxjif_is_mine(device_table *spec, Doc *doc, Node *tag);
extern char *qs_get_destlang_attr(Doc *doc, Node *tag, apr_pool_t *pool);
extern char *qs_get_parse_attr(Doc *doc, Node *tag, apr_pool_t *pool);
-extern char *chxj_form_action_to_hidden_tag(request_rec *r, apr_pool_t *pool, const char *str, int xmlFlag, int post);
+extern char *chxj_form_action_to_hidden_tag(request_rec *r, apr_pool_t *pool, const char *str, int xmlFlag, int post, char **new_query_string, int docomo);
#endif
/*
W_L("<form");
if (attr_value) {
char *q;
+ char *new_query_string = NULL;
q = strchr(attr_value, '?');
if (q) {
- new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_value, 0, post_flag);
+ new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_value, 0, post_flag, &new_query_string, CHXJ_TRUE);
if (new_hidden_tag) {
*q = 0;
}
}
W_L(" action=\"");
W_V(attr_value);
+ if (new_query_string) {
+ W_L("?");
+ W_V(new_query_string);
+ }
W_L("\"");
}
if (attr_method) {
W_L("<form");
if (attr_action) {
char *q;
+ char *new_query_string = NULL;
q = strchr(attr_action, '?');
if (q) {
- new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag);
+ new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE);
if (new_hidden_tag) {
*q = 0;
}
}
W_L(" action=\"");
W_V(attr_action);
+ if (new_query_string) {
+ W_L("?");
+ W_V(new_query_string);
+ }
W_L("\"");
}
if (attr_method) {
W_L("<form");
if (attr_action) {
char *q;
+ char *new_query_string = NULL;
q = strchr(attr_action, '?');
if (q) {
- new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag);
+ new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE);
if (new_hidden_tag) {
*q = 0;
}
}
W_L(" action=\"");
W_V(attr_action);
+ if (new_query_string) {
+ W_L("?");
+ W_V(new_query_string);
+ }
W_L("\"");
}
if (attr_method) {
W_L("<form");
if (attr_action) {
char *q;
+ char *new_query_string = NULL;
q = strchr(attr_action, '?');
if (q) {
- new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag);
+ new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE);
if (new_hidden_tag) {
*q = 0;
}
}
W_L(" action=\"");
W_V(attr_action);
+ if (new_query_string) {
+ W_L("?");
+ W_V(new_query_string);
+ }
W_L("\"");
}
if (attr_method) {
W_L("<form");
if (attr_action) {
char *q;
+ char *new_query_string = NULL;
q = strchr(attr_action, '?');
if (q) {
- new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag);
+ new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE);
if (new_hidden_tag) {
*q = 0;
}
}
W_L(" action=\"");
W_V(attr_action);
+ if (new_query_string) {
+ W_L("?");
+ W_V(new_query_string);
+ }
W_L("\"");
}
if (attr_method) {
W_L("<form");
if (attr_action) {
char *q;
+ char *unused = NULL;
q = strchr(attr_action, '?');
if (q) {
- new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag);
+ new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &unused, CHXJ_FALSE);
if (new_hidden_tag) {
*q = 0;
}
W_L("<form");
if (attr_action) {
char *q;
+ char *unused = NULL;
q = strchr(attr_action, '?');
if (q) {
- new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag);
+ new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag, &unused, CHXJ_FALSE);
if (new_hidden_tag) {
*q = 0;
}
char *
-chxj_form_action_to_hidden_tag(request_rec *r, apr_pool_t *pool, const char *str, int xmlFlag, int post)
+chxj_form_action_to_hidden_tag(request_rec *r, apr_pool_t *pool, const char *str, int xmlFlag, int post, char **new_query_string, int docomo)
{
char *s = apr_pstrdup(pool, str);
+ *new_query_string = NULL;
if (!s) return NULL;
if (chxj_starts_with(s, "http://") || chxj_starts_with(s, "https://")) {
apr_uri_t url;
if (!val) val = "";
}
char *tmp = NULL;
- if (! post || strcasecmp(key, "_chxj_cc") == 0 || strcasecmp(key, "_chxj_nc") == 0) {
- tmp = apr_psprintf(pool, "<input type=\"hidden\" name=\"%s\" value=\"%s\"%s>", key, chxj_url_decode(pool, val), (xmlFlag == 1) ? " /" : "");
+ if (strcasecmp(key, "guid") == 0 && docomo) {
+ *new_query_string = apr_psprintf(pool, "%s=%s", key, val);
}
else {
- tmp = apr_psprintf(pool, "<input type=\"hidden\" name=\"_chxj_qs_%s\" value=\"%s\"%s>", key, chxj_url_decode(pool, val), (xmlFlag == 1) ? " /" : "");
- }
- if (result) {
- result = apr_pstrcat(pool, result, tmp, NULL);
- }
- else {
- result = tmp;
+ if (! post || strcasecmp(key, "_chxj_cc") == 0 || strcasecmp(key, "_chxj_nc") == 0) {
+ tmp = apr_psprintf(pool, "<input type=\"hidden\" name=\"%s\" value=\"%s\"%s>", key, chxj_url_decode(pool, val), (xmlFlag == 1) ? " /" : "");
+ }
+ else {
+ tmp = apr_psprintf(pool, "<input type=\"hidden\" name=\"_chxj_qs_%s\" value=\"%s\"%s>", key, chxj_url_decode(pool, val), (xmlFlag == 1) ? " /" : "");
+ }
+ if (result) {
+ result = apr_pstrcat(pool, result, tmp, NULL);
+ }
+ else {
+ result = tmp;
+ }
}
}
return result;
W_L("<form");
if (attr_action) {
char *q;
+ char *unused = NULL;
q = strchr(attr_action, '?');
if (q) {
- new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag);
+ new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag, &unused, CHXJ_FALSE);
if (new_hidden_tag) {
*q = 0;
}
},
};
-static int chxj_convert_input_header(request_rec *r,chxjconvrule_entry *entryp);
+static int chxj_convert_input_header(request_rec *r,chxjconvrule_entry *entryp, device_table *spec);
+static void s_convert_guid_parameter_to_header(request_rec *r, const char *param, device_table *spec);
static void s_add_cookie_id_if_has_location_header(request_rec *r, cookie_t *cookie);
static void s_clear_cookie_header(request_rec *r, device_table *spec);
HTTP_USER_AGENT,
entryp->user_agent);
- chxj_convert_input_header(r,entryp);
+ chxj_convert_input_header(r,entryp, spec);
break;
/**
+ * convert GUID parameter.
+ *
+ */
+static void
+s_convert_guid_parameter_to_header(request_rec *r, const char *param, device_table *spec)
+{
+ if (strcasecmp(param, "guid") == 0) {
+ switch(spec->html_spec_type) {
+ case CHXJ_SPEC_XHtml_Mobile_1_0:
+ do {
+ char *x_up_subno = (char *)apr_table_get(r->headers_in, "x-up-subno");
+ if (x_up_subno) {
+ apr_table_setn(r->headers_in, "X-DCMGUID", x_up_subno);
+ }
+ } while(0);
+ break;
+ case CHXJ_SPEC_Jhtml:
+ case CHXJ_SPEC_Jxhtml:
+ do {
+ char *x_jphone_uid = (char *)apr_table_get(r->headers_in, "x-jphone-uid");
+ if (x_jphone_uid) {
+ apr_table_setn(r->headers_in, "X-DCMGUID", x_jphone_uid);
+ }
+ } while(0);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+/**
* It converts it from HEADER.
*
* @param r [i]
*/
static int
-chxj_convert_input_header(request_rec *r,chxjconvrule_entry *entryp)
+chxj_convert_input_header(request_rec *r,chxjconvrule_entry *entryp, device_table *spec)
{
char *buff;
else {
dname = "";
}
-
+ s_convert_guid_parameter_to_header(r, dname, spec);
result = apr_pstrcat(r->pool, result, dname, "=", dvalue, NULL);
}
else {
request_rec *r,
const char **src,
apr_size_t *len,
- chxjconvrule_entry *entryp)
+ chxjconvrule_entry *entryp,
+ device_table *spec)
{
char *pair;
char *name;
dname = "";
}
+
result = apr_pstrcat(pool, result, dname, "=", dvalue, NULL);
}
else {
else {
r->args = apr_pstrcat(pool, &name[sizeof(CHXJ_QUERY_STRING_PARAM_PREFIX)-1], "=", dvalue, NULL);
}
+ s_convert_guid_parameter_to_header(r, &name[sizeof(CHXJ_QUERY_STRING_PARAM_PREFIX)-1], spec);
}
}
else
else {
r->args = apr_pstrcat(pool, &name[sizeof(CHXJ_QUERY_STRING_PARAM_PREFIX_ENC)-1], "=", dvalue, NULL);
}
+ s_convert_guid_parameter_to_header(r, &name[sizeof(CHXJ_QUERY_STRING_PARAM_PREFIX_ENC)-1], spec);
}
}
DBG(r, "REQ[%X] ************************ name:[%s]", (unsigned int)(apr_size_t)r, name);
* now convert.
*/
if (post_data_len > 0) {
- post_data = chxj_input_convert(r, (const char**)&post_data, (apr_size_t*)&post_data_len, entryp);
+ post_data = chxj_input_convert(r, (const char**)&post_data, (apr_size_t*)&post_data_len, entryp, spec);
DBG(r, "(in:exchange)POSTDATA:[%s]", post_data);
}