fix(system): drop deprecated by-reference form on uploader error fetches#43
Conversation
Proposed commit / PR body:
PHP 8 deprecation cleanup in four System admin upload handlers.
system/admin/{avatars,images,smilies,userrank}/main.php:
Each file's upload-failure branch wrote
$err[] = & $uploader->getErrors();
i.e. assign-by-reference to the array result of a method call.
This idiom has been a deprecation notice since PHP 7.4 and is
an outright error in current PHP 8.x runs, so every failed
upload was emitting a deprecation warning into admin output.
getErrors() returns an array by value; the assignment is
always copy semantics anyway, so the `& ` is removed.
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 24 minutes and 26 seconds.Comment |
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #43 +/- ##
============================================
- Coverage 19.23% 18.08% -1.15%
- Complexity 7584 7840 +256
============================================
Files 621 665 +44
Lines 40085 42982 +2897
============================================
+ Hits 7709 7775 +66
- Misses 32376 35207 +2831 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request removes deprecated assign-by-reference usage when collecting upload errors in System admin upload handlers, preventing PHP 8.x deprecation notices/errors during failed uploads.
Changes:
- Replaced
$err[] = & $uploader->getErrors();with$err[] = $uploader->getErrors();in four System admin controllers. - Keeps existing error-collection behavior (still compatible with
xoops_error()which handles strings/arrays recursively).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| htdocs/modules/system/admin/userrank/main.php | Removes by-reference assignment when appending uploader errors for rank image uploads. |
| htdocs/modules/system/admin/smilies/main.php | Removes by-reference assignment when appending uploader errors for smilie image uploads. |
| htdocs/modules/system/admin/images/main.php | Removes by-reference assignment when appending uploader errors for image uploads. |
| htdocs/modules/system/admin/avatars/main.php | Removes by-reference assignment when appending uploader errors for avatar uploads. |



Proposed commit / PR body:
PHP 8 deprecation cleanup in four System admin upload handlers.
system/admin/{avatars,images,smilies,userrank}/main.php:
Each file's upload-failure branch wrote
$err[] = & $uploader->getErrors();
i.e. assign-by-reference to the array result of a method call.
This idiom has been a deprecation notice since PHP 7.4 and is
an outright error in current PHP 8.x runs, so every failed
upload was emitting a deprecation warning into admin output.
getErrors() returns an array by value; the assignment is
always copy semantics anyway, so the
&is removed.