New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Form] fixed bug - name in ButtonBuilder #19306

Closed
wants to merge 2 commits into
base: 2.7
from

Conversation

Projects
None yet
4 participants
@cheprasov
Contributor

cheprasov commented Jul 6, 2016

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Bug:

For any scalar of name, expression empty($name) && 0 != $name is never true,
and as result - empty string ('') is allowed.

Examples:

$name = ''; var_dump(empty($name) && 0 != $name); // false
$name = '0'; var_dump(empty($name) && 0 != $name); // false
$name = null; var_dump(empty($name) && 0 != $name); // false
$name = false; var_dump(empty($name) && 0 != $name); // false
$name = 0; var_dump(empty($name) && 0 != $name); // false
@cheprasov

This comment has been minimized.

Show comment
Hide comment
@cheprasov

cheprasov Jul 7, 2016

Contributor

@xabbuh
Fixed.

Contributor

cheprasov commented Jul 7, 2016

@xabbuh
Fixed.

@xabbuh

This comment has been minimized.

Show comment
Hide comment
@xabbuh

xabbuh Jul 8, 2016

Member

👍

Member

xabbuh commented Jul 8, 2016

👍

@fabpot

This comment has been minimized.

Show comment
Hide comment
@fabpot

fabpot Jul 8, 2016

Member

Thank you @cheprasov.

Member

fabpot commented Jul 8, 2016

Thank you @cheprasov.

fabpot added a commit that referenced this pull request Jul 8, 2016

bug #19306 [Form] fixed bug - name in ButtonBuilder (cheprasov)
This PR was squashed before being merged into the 2.7 branch (closes #19306).

Discussion
----------

[Form] fixed bug - name in ButtonBuilder

| Q             | A
| ------------- | ---
| Branch?       |  2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? |no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

**Bug:**

For any scalar of name, expression `empty($name) && 0 != $name` is never true,
and as result - empty string ('') is allowed.

**Examples:**

```php
$name = ''; var_dump(empty($name) && 0 != $name); // false
$name = '0'; var_dump(empty($name) && 0 != $name); // false
$name = null; var_dump(empty($name) && 0 != $name); // false
$name = false; var_dump(empty($name) && 0 != $name); // false
$name = 0; var_dump(empty($name) && 0 != $name); // false
```

Commits
-------

f507023 [Form] fixed bug - name in ButtonBuilder

@fabpot fabpot closed this Jul 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment