Skip to content

Commit 17aa549

Browse files
committed
Detect all controls (hopefully) + add method to check for a handled control
1 parent 838d8d7 commit 17aa549

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/InputCharacter.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@ public function __construct(string $data)
4848
$this->data = $data;
4949
}
5050

51+
public function isHandledControl() : bool
52+
{
53+
return isset(static::$controls[$this->data]);
54+
}
55+
5156
/**
5257
* Is this character a control sequence?
5358
*/
5459
public function isControl() : bool
5560
{
56-
return isset(static::$controls[$this->data]);
61+
return preg_match( '/[\x00-\x1F\x7F]/', $this->data);
5762
}
5863

5964
/**

0 commit comments

Comments
 (0)