mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 09:51:21 -06:00
36 lines
738 B
PHP
36 lines
738 B
PHP
|
<?php
|
||
|
/**
|
||
|
* Description.php
|
||
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||
|
*
|
||
|
* This software may be modified and distributed under the terms
|
||
|
* of the MIT license. See the LICENSE file for details.
|
||
|
*/
|
||
|
|
||
|
declare(strict_types = 1);
|
||
|
|
||
|
namespace FireflyIII\Import\Converter;
|
||
|
|
||
|
/**
|
||
|
* Class Description
|
||
|
*
|
||
|
* @package FireflyIII\Import\Converter
|
||
|
*/
|
||
|
class Description extends BasicConverter implements ConverterInterface
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @param $value
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
|
public function convert($value): string
|
||
|
{
|
||
|
// this should replace all control characters
|
||
|
// but leave utf8 intact:
|
||
|
$value = preg_replace('/[\x00-\x1F\x80-\x9F]/u', '', $value);
|
||
|
|
||
|
return strval($value);
|
||
|
|
||
|
}
|
||
|
}
|