User tests: Successful: Unsuccessful:
The return value is supposed to be a boolean. preg_match however returns 0, 1 or false. Casting to boolean enforces the correct return value.
Cast the return value of MediaHelper->isImage to boolean as expected by the function documentation.
The return value is used in the getMineType function as second argument and is also expected to be boolean there. In that method, it also is explicitely checked if "true", which it currently never is (remember, preg_match never returns "true").
Uploading an image in the media manager should work the same, before and after that change.
I only noticed this, when I tried to implement the helper with my own extension and it had issues detecting the mime of an image.
Upload works
Upload works
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Title |
|
||||||
I have tested this item ✅ successfully on ac6e03e
I have tested this item ✅ successfully on ac6e03e
I have tested this item ✅ successfully on ac6e03e
| Status | Pending | ⇒ | Ready to Commit |
RTC
RTC
| Labels |
Added:
RTC
PR-5.4-dev
|
||
✅ Final test before merge
| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-09-04 14:27:24 |
| Closed_By | ⇒ | muhme | |
| Labels |
Added:
bug
|
||
I have tested this item ✅ successfully on ac6e03e
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48347.