mirror of
https://github.com/HaschekSolutions/opentrashmail.git
synced 2026-04-25 14:45:59 +03:00
[GH-ISSUE #31] API returns "invalid email address" for every email address #18
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentrashmail#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Dan-Q on GitHub (Aug 12, 2021).
Original GitHub issue: https://github.com/HaschekSolutions/opentrashmail/issues/31
Change
935d11a189wrapsstrtolower($_REQUEST['email'])inbasename(realpath(...)), which is important for preventing path traversal attacks... but breaks much of the functionality.Making this change means that the
$emailvariable contains a path, not an email address, and so subsequent calls tofilter_var($email, FILTER_VALIDATE_EMAIL)always returnfalse. Therefore, the API does not work.Suggested change: perform all email filtering at the top, before running
basename/realpath, and return the error only if (a) an email request parameter is passed and (b) the filter returns false. Then just use and trust the$emailvariable in theattachment,load, andlistmethods.@Dan-Q commented on GitHub (Aug 12, 2021):
Dupe of #29.