Skip to content

Instantly share code, notes, and snippets.

@Saeven
Created March 23, 2017 16:26
Show Gist options
  • Select an option

  • Save Saeven/12cde3156bb24d539a8d4357b3aee26e to your computer and use it in GitHub Desktop.

Select an option

Save Saeven/12cde3156bb24d539a8d4357b3aee26e to your computer and use it in GitHub Desktop.
MultibyteGuardFilter
<?php
namespace LDP\Form\Filter;
class MultibyteGuard implements \Zend\Filter\FilterInterface
{
public function filter($value)
{
if (!mb_check_encoding($value, 'utf-8')) {
$value = '';
}
return $value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment