Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
fixing broken merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tr committed Aug 16, 2012
2 parents 4d5f078 + 533570c commit bb991fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/StringTrim.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function unicodeTrim($value, $charlist = '\\\\s')
$charlist
);

$pattern = '/^[' . $chars . ']*|[' . $chars . ']*$/sSD';
$pattern = '/^[' . $chars . ']+|[' . $chars . ']+$/usSD';

return preg_replace($pattern, '', $value);
}
Expand Down
13 changes: 13 additions & 0 deletions test/StringTrimTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ public function testBasic()
}
}

/**
* Ensures that the filter follows expected behavior
*
* @return void
*/
public function testUtf8()
{
if (version_compare(PHP_VERSION, '5.3.4', 'lt')) {
$this->markTestSkipped('PCRE update in 5.3.4 fixes unicode whitespace checking issues; in 5.3.3, this test fails due to outdated PCRE version');
}
$this->assertEquals('a', $this->_filter->filter(utf8_encode("\xa0a\xa0")));
}

/**
* Ensures that getCharList() returns expected default value
*
Expand Down

0 comments on commit bb991fd

Please sign in to comment.