Ensure string casting safety

This commit is contained in:
Alejandro Celaya 2020-09-24 22:15:26 +02:00
parent 2555424124
commit cfc9a1b772

View File

@ -21,6 +21,7 @@ use function array_map;
use function Functional\curry;
use function Functional\flatten;
use function Functional\unique;
use function method_exists;
use function sprintf;
use function strpos;
@ -165,7 +166,7 @@ class GenerateShortUrlCommand extends Command
private function doValidateUrl(InputInterface $input): ?bool
{
$rawInput = (string) $input;
$rawInput = method_exists($input, '__toString') ? $input->__toString() : '';
if (strpos($rawInput, '--no-validate-url') !== false) {
return false;