Opened 3 months ago
Last modified 3 weeks ago
#9175 new defect (bug)
Unable to send "0" in messages through REST API
Reported by: | niftythree | Owned by: | espellcaste |
---|---|---|---|
Milestone: | 15.0.0 | Priority: | highest |
Severity: | normal | Version: | |
Component: | REST API | Keywords: | has-patch has-unit-tests |
Cc: | emaralive |
Description
Hello,
We've found that the REST API cannot send 0 (i.e. the digit for zero) as the only content for a message. This applies to messages in both new and existing threads (see first screenshot). However, it will accept other variations. E.g. 00; 01; 10; etc. as the only content of a message, and it doesn't appear to be an issue for any other numbers/digits (see second screenshot).
We've tested all of the above with the following set-up:
WordPress version: 6.5.3
BuddyPress version: 12.5.0
BuddyPress Template: Legacy
Theme: Twenty Twenty-Four
Plugins active: BuddyPress, JSON Basic Authentication (https://github.com/WP-API/Basic-Auth)
PHP: 7.4
Thanks.
Attachments (2)
Change History (10)
#2
@
3 months ago
Thanks @espellcaste; we appreciate it being updated and the context you've provided.
This ticket was mentioned in PR #330 on buddypress/buddypress by renatonascalves.
2 months ago
#4
- Keywords has-patch has-unit-tests added
Trac ticket: https://buddypress.trac.wordpress.org/ticket/9175
That's a good catch, actually.
In PHP,
empty("0")
returnstrue
whileempty("00")
does not. I can update this to better check what's truly empty.