Handle non-alnum parameters with --eval#1306
Closed
Rogdham wants to merge 1 commit intosqlmapproject:masterfrom
Closed
Handle non-alnum parameters with --eval#1306Rogdham wants to merge 1 commit intosqlmapproject:masterfrom
Rogdham wants to merge 1 commit intosqlmapproject:masterfrom
Conversation
Author
|
Hello @stamparm, I see you closed this merge request. Could you explain how to handle parameters with dots in them (or non-ASCII parameters) in the Python code called from |
Member
|
Please update and retry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using
--evalto edit some parameters using some custom Python code, it is not possible to edit some parameters, for example containing dots (foo.bar). Currently, non-alnum chars are deleted before the custom Python code is evaluated, and are not put back afterwards.There is already code in place to handle the cases where the parameters are Python keywords (e.g.
if), by appending the suffix_KEYWORDto them (EVALCODE_KEYWORD_SUFFIX). This means that we can edit theif_KEYWORDPython variable instead ofif.The idea of this PR is to do something similar with non-alnum (
[^\w]) chars in parameters. Each non-alnum char is replaced by a delimiter, can then be modified in the Python code (the one passed using--eval) and then replaced back to the original parameter.Here are some examples with the implementation of this PR:
--eval's Python codefoofoofoo_barfoo_barfoo.barfoo_0x2e_bar_0x42_0x43__0x5f_0x42_0x5f_0x43_B0x43_or_0x42Ccafécaf_0xc3__0xa9_I hope everything makes sense, please ask questions if it's not the case!