You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 13, 2022. It is now read-only.
The problem seems to be that the _replace_substrings function sees the open bracket from the get function and matches it with the close bracket in the string resulting in actions.get("5a8c9aaa-b87b-4a28-8a91-1c3db5de2d13")bracket")
I've got a few ideas about how to fix this but I'm not sure what the best approach is;
Add a check replace quoted strings before replacing brackets, I think this is the best solution but worry it might introduce new bugs with quotation marks.
Add a check to see if the number of brackets is balanced, and if not handled it somehow.
In the _replace_substrings function, work from the outside in, so when looping through look for the ( with code[i] and look for the ) with code[-i]. The problem with that is a string like this is (a) (test) string would end up as this is ("5a8c9aaa-b87b-4a28-8a91-1c3db5de2d13") string and I'm not sure if that would break things.
Maybe some other approach?
The text was updated successfully, but these errors were encountered:
HybridAU
changed the title
Unclosed bracer in strings
Unclosed brackets in strings
Apr 22, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Using code that has an unclosed bracket inside a string can cause a 500 server error. For example the test
The problem seems to be that the _replace_substrings function sees the open bracket from the get function and matches it with the close bracket in the string resulting in
actions.get("5a8c9aaa-b87b-4a28-8a91-1c3db5de2d13")bracket")
I've got a few ideas about how to fix this but I'm not sure what the best approach is;
_replace_substrings
function, work from the outside in, so when looping through look for the ( withcode[i]
and look for the ) withcode[-i]
. The problem with that is a string likethis is (a) (test) string
would end up asthis is ("5a8c9aaa-b87b-4a28-8a91-1c3db5de2d13") string
and I'm not sure if that would break things.The text was updated successfully, but these errors were encountered: