Skip to content

WButton is allowing 'whitespace only' text #1785

@JohnMcGuinness

Description

@JohnMcGuinness

If a WButton has text that is empty, as defined by Util.empty, and also does not have an image URL, accessible text or a tooltip, then an error should be thrown by WButtonRenderer.

The Util.empty method's java doc says it returns 'true if the given String is null or contains only whitespace'. This is incorrect as it only checks for white space that has a character code which is less than the ' ' (space) characters code. It ignores any whitespace that has a character code greater than that. There are many Unicode Whitespace characters with a code greater than the space characters character code.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions