[wp-trac] [WordPress Trac] #22692: Quotes Are Messing Up
WordPress Trac
noreply at wordpress.org
Fri Nov 1 01:20:48 UTC 2013
#22692: Quotes Are Messing Up
----------------------------------------+-----------------------------
Reporter: miqrogroove | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Formatting | Version: 3.4.2
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests |
----------------------------------------+-----------------------------
Comment (by azaozz):
The tests look good, but... There is something going on here. Without the
`u` modifier, in some cases `\s` matches `\xA0` which happens to be the
second byte from U+00A0 and all works as expected. The tests pass.
Adding this to any testcase:
{{{
/**
* @ticket 999999
*/
function test_regex_xa0() {
$this->assertTrue( 1 === preg_match( '/^\s$/', "\xA0" ) );
$this->assertRegExp( '/^\s$/', "\xA0" );
}
}}}
Then run it with `phpunit --group 999999`. Both pass on my test install.
However this:
{{{
add_action( 'shutdown', 'my_test_s' );
function my_test_s() {
var_dump( preg_match( '/^\s$/', "\xA0" ) );
}
}}}
outputs `int(0)`... So which one is right?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22692#comment:35>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list