Commit a445c8c
committed
✨ Enable parenthesized lists in search criteria
This affects search, uid_search, sort, uid_sort, thread, and uid_thread.
Prior to this, sending a parenthesized list in the search criteria for
any of these commands required the use of strings, which are converted
to RawData, which has security implications with untrusted inputs.
With this change, arrays will only be converted into SequenceSet when
_every_ element in the array is a valid SequenceSet input. Otherwise,
the array will be left alone, which allows us to send parenthesized
lists without using strings and RawData.
For example, some search criteria this change enables:
* `["not", %w[flagged unread]]` converts to `not (flagged unread)`.
* `["return", ["partial", 1..50]]` converts to `return (partial 1:50)`.1 parent 14e2c6c commit a445c8c
File tree
3 files changed
+49
-41
lines changed- lib/net
- imap
- test/net/imap
3 files changed
+49
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1939 | 1939 | | |
1940 | 1940 | | |
1941 | 1941 | | |
1942 | | - | |
1943 | | - | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
1944 | 1945 | | |
1945 | 1946 | | |
1946 | 1947 | | |
| |||
1956 | 1957 | | |
1957 | 1958 | | |
1958 | 1959 | | |
1959 | | - | |
1960 | | - | |
| 1960 | + | |
| 1961 | + | |
1961 | 1962 | | |
1962 | 1963 | | |
1963 | 1964 | | |
| |||
2963 | 2964 | | |
2964 | 2965 | | |
2965 | 2966 | | |
2966 | | - | |
2967 | | - | |
2968 | | - | |
2969 | | - | |
2970 | | - | |
| 2967 | + | |
| 2968 | + | |
2971 | 2969 | | |
2972 | | - | |
2973 | | - | |
2974 | | - | |
2975 | | - | |
2976 | | - | |
| 2970 | + | |
2977 | 2971 | | |
2978 | 2972 | | |
2979 | 2973 | | |
| |||
3020 | 3014 | | |
3021 | 3015 | | |
3022 | 3016 | | |
3023 | | - | |
3024 | | - | |
3025 | | - | |
3026 | | - | |
3027 | | - | |
| 3017 | + | |
3028 | 3018 | | |
3029 | 3019 | | |
3030 | 3020 | | |
3031 | 3021 | | |
3032 | 3022 | | |
3033 | 3023 | | |
3034 | 3024 | | |
3035 | | - | |
3036 | | - | |
3037 | | - | |
3038 | | - | |
3039 | | - | |
| 3025 | + | |
3040 | 3026 | | |
3041 | 3027 | | |
3042 | 3028 | | |
3043 | 3029 | | |
3044 | 3030 | | |
3045 | 3031 | | |
3046 | | - | |
3047 | | - | |
3048 | | - | |
3049 | | - | |
3050 | | - | |
3051 | | - | |
3052 | | - | |
3053 | | - | |
3054 | | - | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
3055 | 3035 | | |
3056 | 3036 | | |
3057 | 3037 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
279 | 282 | | |
280 | 283 | | |
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
284 | 287 | | |
285 | | - | |
| 288 | + | |
286 | 289 | | |
287 | | - | |
288 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
289 | 302 | | |
290 | 303 | | |
291 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1206 | 1206 | | |
1207 | 1207 | | |
1208 | 1208 | | |
1209 | | - | |
1210 | | - | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1211 | 1214 | | |
1212 | 1215 | | |
1213 | 1216 | | |
1214 | | - | |
1215 | | - | |
1216 | | - | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
1217 | 1220 | | |
1218 | 1221 | | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
1219 | 1234 | | |
1220 | 1235 | | |
1221 | 1236 | | |
| |||
0 commit comments