Created
March 23, 2017 16:26
-
-
Save Saeven/12cde3156bb24d539a8d4357b3aee26e to your computer and use it in GitHub Desktop.
MultibyteGuardFilter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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