View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0036303 | mantisbt | attachments | public | 2025-09-17 03:20 | 2025-11-04 02:22 |
| Reporter | Debdutta | Assigned To | dregad | ||
| Priority | normal | Severity | minor | Reproducibility | sometimes |
| Status | closed | Resolution | fixed | ||
| Platform | web | OS | mac | OS Version | macOS 10.15 |
| Product Version | 2.27.1 | ||||
| Target Version | 2.27.2 | Fixed in Version | 2.27.2 | ||
| Summary | 0036303: Uploading a file when $g_antispam_max_event_count has been reached causes Dropzone to display HTML code | ||||
| Description | Sometimes attachment section shows error(actually and html content) when upload a file | ||||
| Steps To Reproduce | happens sometimes so could not reproduce intensionally | ||||
| Additional Information | video | ||||
| Tags | No tags attached. | ||||
|
Is the problem always occurring with the same specific file or file type ? |
|
|
Actually I just noticed that you scrolled down 6-7 seconds into your video, and captured a screenshot which allowed me to identify the error message I was looking for: APPLICATION ERROR 27: You have reached the allowed activity limit of 10 events within the last 3600 seconds; your action has been blocked to avoid spam, please try again later So the problem is caused by MantisBT's antispam settings, which are possibly too low to accommodate your user's activity. As a workaround I suggest you adjust those as appropriate ($g_antispam_max_event_count, $g_antispam_time_window_in_seconds) or wait until the antispam delay expires and try again. That being said, I would expect the AJAX to fail gracefully in such case, and not display HTML code on the screen. |
|
|
@atrol why did you change the target version, it was correct |
|
|
@dregad "Fixed in Version" was set to 2.28.0, but "Target Version" was set to 2.27.2. |
|
|
Ah yes that makes sense now. It's because I had the wrong target branch on the PR when I merged it, then I made a second merge to master-2.27 but did not realize that source integration did not pick that up and changed the fixed in version. My mistake, thanks for noticing. |
|
|
MantisBT: master 0faf5a5c 2025-09-17 13:01 Details Diff |
Prevent HTML output in Dropzone when errors occur A somewhat hackish solution, leveraging the existing behavior in the error handler, driven by the DISABLE_INLINE_ERROR_REPORTING constant. When bug_report.php or bugnote_add.php are called via AJAX (as is the case when Dropzone handles file uploads), the constant is set with a new value of `text`. This is picked up by error_handler(), which sends the error message in the response body as plain text. Note: AJAX detection relies on presence of non-standard X-Requested-With header with value 'XMLHttpRequest' (which is set by Dropzone [1]). Fixes 0036303 [1]: https://github.com/mantisbt/mantisbt/blob/38a569855832c9d5cc63ee8bdf5a96c9b0c60e84/js/dropzone-5.5.0.js#L2446 |
Affected Issues 0036303 |
|
| mod - bug_report.php | Diff File | ||
| mod - bugnote_add.php | Diff File | ||
| mod - core/error_api.php | Diff File | ||