Skip to content

fix(webserver): ed2k links add via footer links form - #145

Merged
got3nks merged 1 commit into
amule-org:masterfrom
RealGreenDragon:skip-ed2k-empty-links
Jun 13, 2026
Merged

fix(webserver): ed2k links add via footer links form#145
got3nks merged 1 commit into
amule-org:masterfrom
RealGreenDragon:skip-ed2k-empty-links

Conversation

@RealGreenDragon

Copy link
Copy Markdown

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_cmd call links form of footer.php to 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:

!2026-06-12 16:01:00: ExternalConn: adding link 'ed2k://'.
!2026-06-12 16:01:00: Invalid eD2k link! ERROR: Not a valid ed2k-URI
!2026-06-12 16:01:00: ExternalConn: adding link 'ed2k://|file|<FILE_DATA>/ '.
!2026-06-12 16:01:00: <SUCCESS_MSG>

After:

!2026-06-12 16:09:00: ExternalConn: adding link 'ed2k://|file|<FILE_DATA>/ '.
!2026-06-12 16:09:00: <SUCCESS_MSG>

@got3nks got3nks left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@got3nks
got3nks merged commit ebe5a2d into amule-org:master Jun 13, 2026
1 check passed
@RealGreenDragon
RealGreenDragon deleted the skip-ed2k-empty-links branch June 13, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants