Sepia\PoParser::clean PHP Method

clean() protected method

Undos cleanExport actions on a string.
protected clean ( string | array $x ) : string | array.
$x string | array
return string | array.
    protected function clean($x)
    {
        if (is_array($x)) {
            foreach ($x as $k => $v) {
                $x[$k] = $this->clean($v);
            }
        } else {
            // Remove double quotes from start and end of string
            if ($x == '') {
                return '';
            }
            if ($x[0] == '"') {
                $x = substr($x, 1, -1);
            }
            // Escapes C-style escape sequences (\a,\b,\f,\n,\r,\t,\v) and converts them to their actual meaning
            $x = stripcslashes($x);
        }
        return $x;
    }