NukeViet\Core\Request::_get_title PHP Méthode

_get_title() private méthode

Request::_get_title()
private _get_title ( mixed $value, mixed $specialchars, mixed $preg_replace )
$value mixed
$specialchars mixed
$preg_replace mixed
    private function _get_title($value, $specialchars, $preg_replace)
    {
        $value = strip_tags($value);
        if ((bool) $specialchars == true) {
            $search = array('&', '\'', '"', '<', '>', '\\', '/', '(', ')', '*', '[', ']', '!', '=', '%', '^', ':', '{', '}', '`', '~');
            $replace = array('&amp;', '&#039;', '&quot;', '&lt;', '&gt;', '&#x005C;', '&#x002F;', '&#40;', '&#41;', '&#42;', '&#91;', '&#93;', '&#33;', '&#x3D;', '&#x25;', '&#x5E;', '&#x3A;', '&#x7B;', '&#x7D;', '&#x60;', '&#x7E;');
            $value = str_replace($replace, $search, $value);
            $value = str_replace("&#x23;", "#", $value);
            $value = str_replace($search, $replace, $value);
            $value = preg_replace("/([^\\&]+)\\#/", "\\1&#x23;", $value);
        }
        if (!empty($preg_replace)) {
            if (isset($preg_replace['pattern']) and !empty($preg_replace['pattern']) and isset($preg_replace['replacement'])) {
                $value = preg_replace($preg_replace['pattern'], $preg_replace['replacement'], $value);
            }
        }
        return trim($value);
    }