[wp-trac] [WordPress Trac] #41852: Fix UN flag test by returning the correct value.
WordPress Trac
noreply at wordpress.org
Wed Sep 13 23:44:01 UTC 2017
#41852: Fix UN flag test by returning the correct value.
---------------------------+-----------------------
Reporter: peterwilsoncc | Owner: pento
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.8.2
Component: Emoji | Version: 4.8
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
---------------------------+-----------------------
Comment (by peterwilsoncc):
Replying to [comment:2 ocean90]:
> I'm not really following. Could you provide some steps to replicate the
issue and why it doesn't apply to the England flag?
The tests are considered to fail (return false) if both flags look the
same.
The UN test is effectively returning `flag === flag2`, ie true if
identical.
The English flag returns `flag !== flag2`, ie false if identical.
The way the tests are written means the affect is minimal as users are
more likely to get a false negative than a false positive.
I've put together a reduced test case at
https://jsbin.com/palagay/2/edit?js,output
1. Visit the [https://jsbin.com/palagay/2/edit?js,output test case] to see
if your browser supports the UN flag (Chrome 61/MacOS Sierra will not)
2. The outcome will display the images.
3. To test in core, change the UN flag test to end:
{{{#!js
if ( flag !== flag2 ) {
console.log( 'fail' );
return false;
}
console.log( 'pass' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41852#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list