Skip to content

Commit

Permalink
Fix client parse errors with '=' in remark strings (tindy2013#632)
Browse files Browse the repository at this point in the history
Replace every '=' with '-' in the remark string to avoid parse errors from the clients.
  • Loading branch information
MDX-Tom authored and kadaliao committed Oct 16, 2023
1 parent d08ca0c commit 6a4e7a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/generator/config/subexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ bool applyMatcher(const std::string &rule, std::string &real_rule, const Proxy &

void processRemark(std::string &oldremark, std::string &newremark, string_array &remarks_list, bool proc_comma = true)
{
// Replace every '=' with '-' in the remark string to avoid parse errors from the clients.
// Surge is tested to yield an error when handling '=' in the remark string,
// not sure if other clients have the same problem.
std::replace(oldremark.begin(), oldremark.end(), '=', '-');

if(proc_comma)
{
if(oldremark.find(',') != std::string::npos)
Expand Down

0 comments on commit 6a4e7a2

Please sign in to comment.