feat: improved error handling in controllers, cleanup
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form\DataTransformer;
|
||||
|
||||
use Symfony\Component\Form\DataTransformerInterface;
|
||||
use voku\helper\AntiXSS;
|
||||
|
||||
class XssCleanTransformer implements DataTransformerInterface
|
||||
{
|
||||
private ?AntiXSS $antiXss = null;
|
||||
|
||||
public function transform(mixed $value): mixed
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function reverseTransform(mixed $value): mixed
|
||||
{
|
||||
if (false === is_string($value) || true === empty($value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
if (null === $this->antiXss) {
|
||||
$this->antiXss = new AntiXSS();
|
||||
}
|
||||
|
||||
return $this->antiXss->xss_clean($value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user