Skip to content

Commit d11c8c6

Browse files
authored
fix: adds check to remove quotes from value text in npctalk(#4096)
1 parent 7abf62b commit d11c8c6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Utils.pm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,9 +1589,12 @@ sub parse_portal_conversation_args {
15891589
# Check current position
15901590
$i = pos($command);
15911591

1592-
# Handle quoted strings
1593-
if ($command =~ /\G(["'])(.*?)\1\s*/gc) {
1594-
push @args, $2;
1592+
# Handle key=value where value can be quoted string (remove quotes)
1593+
if ($command =~ /\G(\w+)=("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\s*/gc) {
1594+
my ($key, $val) = ($1, $2);
1595+
# Remove the quotes around $val
1596+
$val =~ s/^["'](.*)["']$/$1/;
1597+
push @args, "$key=$val";
15951598
}
15961599
# Handle regex r~/.../flags
15971600
elsif ($command =~ /\Gr~\/((?:\\\/|[^\/])+)\/([a-z]*)\s*/gc) {
@@ -1825,4 +1828,4 @@ sub pin_encode {
18251828
}
18261829
}
18271830

1828-
1;
1831+
1;

0 commit comments

Comments
 (0)