Commit 063e7f6
fix(files): validate firmware download input and repair UI param name (#1004)
DownloadNewFirmwareAction read $data['url']/['md5']/['size'] with no checks,
producing "Undefined array key" warnings (Sentry #27054, 48 events). The
frontend was also sending params.updateLink while the backend expected url,
so downloads triggered from the UI never actually worked.
Validate url (http/https) and md5 (32 hex) up-front and return HTTP 400 on
bad input. Normalize md5 to lowercase since WorkerDownloader compares against
md5_file() output. Drop the dead 'size' field from download_settings.json:
WorkerDownloader reads file size from the Content-Length header and never
touches settings['size']. Update the UI to send params.url, and mark md5 as
required in the OpenAPI attribute to match actual worker behavior.1 parent 4bab4a6 commit 063e7f6
4 files changed
Lines changed: 39 additions & 18 deletions
File tree
- sites/admin-cabinet/assets/js
- pbx/Update
- src/Update
- src/PBXCoreREST
- Controllers/Files
- Lib/Files
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | 190 | | |
192 | 191 | | |
193 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
51 | 77 | | |
52 | 78 | | |
53 | 79 | | |
54 | 80 | | |
55 | 81 | | |
56 | 82 | | |
57 | | - | |
| 83 | + | |
58 | 84 | | |
59 | | - | |
60 | | - | |
| 85 | + | |
| 86 | + | |
61 | 87 | | |
62 | 88 | | |
63 | 89 | | |
| |||
71 | 97 | | |
72 | 98 | | |
73 | 99 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 100 | + | |
| 101 | + | |
77 | 102 | | |
78 | 103 | | |
79 | 104 | | |
| |||
84 | 109 | | |
85 | 110 | | |
86 | 111 | | |
87 | | - | |
88 | | - | |
89 | 112 | | |
90 | 113 | | |
91 | 114 | | |
| |||
0 commit comments