Commit add6bdc
authored
FIX: avoid dangling base64 images on rich editor (#36615)
When using the rich editor, when you paste an HTML containing a base64
image, the `dataImageUploader` ProseMirror plugin triggers uploads for
each image and replaces it inline after completed.
Uploads won't succeed if `authorized_extensions` doesn't allow any image
extensions, and in this case the base64 images are kept in the document,
an unintended outcome.
This PR updates the `dataImageUploader` handler to replace any base64
images by an "image" string before starting any upload process.1 parent 6325777 commit add6bdc
File tree
3 files changed
+64
-18
lines changed- config/locales
- frontend/discourse/app/static/prosemirror/extensions
- spec/system/composer
3 files changed
+64
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3158 | 3158 | | |
3159 | 3159 | | |
3160 | 3160 | | |
| 3161 | + | |
| 3162 | + | |
3161 | 3163 | | |
3162 | 3164 | | |
3163 | 3165 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
354 | 376 | | |
355 | 377 | | |
356 | 378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1136 | 1136 | | |
1137 | 1137 | | |
1138 | 1138 | | |
1139 | | - | |
1140 | | - | |
| 1139 | + | |
| 1140 | + | |
1141 | 1141 | | |
1142 | | - | |
| 1142 | + | |
| 1143 | + | |
1143 | 1144 | | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
| 1145 | + | |
1147 | 1146 | | |
1148 | | - | |
| 1147 | + | |
1149 | 1148 | | |
1150 | | - | |
| 1149 | + | |
1151 | 1150 | | |
1152 | | - | |
1153 | | - | |
| 1151 | + | |
1154 | 1152 | | |
1155 | | - | |
1156 | | - | |
| 1153 | + | |
| 1154 | + | |
1157 | 1155 | | |
1158 | | - | |
| 1156 | + | |
| 1157 | + | |
1159 | 1158 | | |
1160 | | - | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
1161 | 1162 | | |
1162 | | - | |
| 1163 | + | |
1163 | 1164 | | |
1164 | | - | |
| 1165 | + | |
1165 | 1166 | | |
1166 | | - | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
1167 | 1173 | | |
1168 | | - | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
1169 | 1191 | | |
1170 | 1192 | | |
1171 | 1193 | | |
| |||
0 commit comments