File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -2172,15 +2172,17 @@ def search(request, searched=""):
2172
2172
2173
2173
if not term :
2174
2174
value = value .lower ()
2175
- if re .match (r"^([a-fA-F\d]{32})$" , value ):
2175
+ split_by = "," if "," in value else " "
2176
+ tmp_value = value .split (split_by )[0 ]
2177
+ if len (tmp_value ) == 64 and re .match (r"^([a-fA-F\d]{64})$" , tmp_value ):
2178
+ term = "sha256"
2179
+ elif len (tmp_value ) == 32 and re .match (r"^([a-fA-F\d]{32})$" , tmp_value ):
2176
2180
term = "md5"
2177
- elif re .match (r"^([a-fA-F\d]{40})$" , value ):
2181
+ elif len ( tmp_value ) == 40 and re .match (r"^([a-fA-F\d]{40})$" , tmp_value ):
2178
2182
term = "sha1"
2179
- elif re .match (r"^([a-fA-F\d]{64})$" , value ):
2180
- term = "sha256"
2181
- elif re .match (r"^([a-fA-F\d]{96})$" , value ):
2183
+ elif len (tmp_value ) == 96 and re .match (r"^([a-fA-F\d]{96})$" , tmp_value ):
2182
2184
term = "sha3"
2183
- elif re .match (r"^([a-fA-F\d]{128})$" , value ):
2185
+ elif len ( tmp_value ) == 128 and re .match (r"^([a-fA-F\d]{128})$" , tmp_value ):
2184
2186
term = "sha512"
2185
2187
2186
2188
if term == "ids" :
You can’t perform that action at this time.
0 commit comments