2013-01-20 19:01:34 +01:00
|
|
|
<?php
|
2015-06-08 16:47:14 +02:00
|
|
|
|
2015-06-08 17:09:25 +02:00
|
|
|
/*
|
|
|
|
* This file is part of Respect/Validation.
|
|
|
|
*
|
|
|
|
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
|
|
|
|
*
|
2019-05-23 16:21:34 +02:00
|
|
|
* For the full copyright and license information, please view the LICENSE file
|
|
|
|
* that was distributed with this source code.
|
2015-06-08 17:09:25 +02:00
|
|
|
*/
|
|
|
|
|
2017-11-19 19:01:31 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2013-01-20 19:01:34 +01:00
|
|
|
namespace Respect\Validation\Rules;
|
|
|
|
|
2019-02-07 13:15:15 +01:00
|
|
|
use function ctype_cntrl;
|
|
|
|
|
2018-11-25 17:56:04 +01:00
|
|
|
/**
|
2019-02-07 13:15:15 +01:00
|
|
|
* Validates if all of the characters in the provided string, are control characters.
|
|
|
|
*
|
2018-11-25 17:56:04 +01:00
|
|
|
* @author Andre Ramaciotti <andre@ramaciotti.com>
|
2019-02-07 13:15:15 +01:00
|
|
|
* @author Danilo Correa <danilosilva87@gmail.com>
|
2018-11-25 17:56:04 +01:00
|
|
|
* @author Henrique Moody <henriquemoody@gmail.com>
|
|
|
|
* @author Nick Lombard <github@jigsoft.co.za>
|
|
|
|
*/
|
2019-05-11 19:30:47 +02:00
|
|
|
final class Control extends AbstractFilterRule
|
2013-01-20 19:01:34 +01:00
|
|
|
{
|
2019-02-07 13:15:15 +01:00
|
|
|
/**
|
2019-04-05 14:33:00 +02:00
|
|
|
* {@inheritDoc}
|
2019-02-07 13:15:15 +01:00
|
|
|
*/
|
2018-09-24 21:48:41 +02:00
|
|
|
protected function validateFilteredInput(string $input): bool
|
2013-01-22 21:08:55 +01:00
|
|
|
{
|
2013-01-22 06:15:57 +01:00
|
|
|
return ctype_cntrl($input);
|
|
|
|
}
|
|
|
|
}
|