fix(webserver): ed2k links add via footer links form - #145
Merged
Conversation
got3nks
approved these changes
Jun 13, 2026
got3nks
left a comment
There was a problem hiding this comment.
Thanks for the contribution. The fix is correct: split("ed2k://", $link) on "ed2k://…" produces a leading empty element, the loop turns that into a bare "ed2k://" call, and the daemon logs it as an invalid link. The new strlen($linkn) > 0 guard skips just that case and matches the existing style at line 28 (if ( strlen($link) > 0 )). Multi-link input stays intact.
NOTE: I'm unsure if PR should be opened here in amule-org repo or in old amule-project repo
You're in the right place — amule-org/amule is where active development continues; amule-project/amule is frozen and no longer accepts merges.
Will merge once CI goes green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Currently if any valid edk2 link is added via amuleweb links form in log two "adding link" lines appeared: the first is an error, the second the correct add.
This behavior occurs because splitting an ed2k link by its prefix ('ed2k://') yields a list with a minimum of two elements, where the first element is always an empty string.
Added length check before
amule_do_ed2k_download_cmdcall links form offooter.phpto avoid this.Bug already fixed by me in AmuleWebUI-Reloaded with this PR.
NOTE: I'm unsure if PR should be opened here in amule-org repo or in old amule-project repo (please says me the correct place).
Test plan
amuleweb logs when adding any single ed2k link before/after the fix.
Before:
After: