File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -2031,6 +2031,10 @@ static void common_chat_parse_glm_4_5(common_chat_msg_parser & builder) {
20312031 gen_partial_args ([&](auto &&rest, auto &&needle){arguments[rest + needle] = " " ;});
20322032 throw common_chat_msg_partial_exception (" Expected </arg_key> after <arg_key>" );
20332033 }
2034+ if (key_res->groups [0 ].end - key_res->groups [0 ].begin != 10 ) {
2035+ gen_partial_args ([&](auto &&rest, auto &&needle){arguments[key_res->prelude + needle] = " " ;});
2036+ throw common_chat_msg_partial_exception (" Expected </arg_key> after <arg_key>" );
2037+ }
20342038 auto &key = key_res->prelude ;
20352039 builder.consume_spaces ();
20362040
@@ -2070,6 +2074,10 @@ static void common_chat_parse_glm_4_5(common_chat_msg_parser & builder) {
20702074 // If not, parse as plain text
20712075 if (val_start == builder.pos ()) {
20722076 if (auto value_plain = builder.try_find_literal (" </arg_value>" )) {
2077+ if (value_plain->groups [0 ].end - value_plain->groups [0 ].begin != 12 ) {
2078+ gen_partial_args ([&](auto &&rest, auto &&needle){arguments[key] = value_plain->prelude + needle;});
2079+ throw common_chat_msg_partial_exception (" Expected </arg_value> after <arg_value>" );
2080+ }
20732081 arguments[key] = value_plain->prelude ;
20742082 } else {
20752083 gen_partial_args ([&](auto &&rest, auto &&needle){arguments[key] = rest + needle;});
You can’t perform that action at this time.
0 commit comments