Skip to content

Commit

Permalink
For some reason, this makes my PHP segfault if there are non-ascii ch…
Browse files Browse the repository at this point in the history
…ars.
  • Loading branch information
yunosh committed May 8, 2015
1 parent 4ac5e71 commit bf867cd
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -12,6 +12,9 @@ class UnexpectedTokenException extends \Exception {
private $sMatchType;

public function __construct($sExpected, $sFound, $sMatchType = 'literal') {
if (preg_match('/[^[:ascii:]]/', $sFound)) {
$sFound = bin2hex($sFound);
}
$this->sExpected = $sExpected;
$this->sFound = $sFound;
$this->sMatchType = $sMatchType;
Expand Down

0 comments on commit bf867cd

Please sign in to comment.