Prado\Exceptions\TErrorHandler::hideSecurityRelated PHP Méthode

hideSecurityRelated() protected static méthode

Since: 3.1.6
protected static hideSecurityRelated ( string $value, $exception = null ) : string
$value string
Résultat string
    protected static function hideSecurityRelated($value, $exception = null)
    {
        $aRpl = array();
        if ($exception !== null && $exception instanceof \Exception) {
            $aTrace = $exception->getTrace();
            foreach ($aTrace as $item) {
                if (isset($item['file'])) {
                    $aRpl[dirname($item['file']) . DIRECTORY_SEPARATOR] = '<hidden>' . DIRECTORY_SEPARATOR;
                }
            }
        }
        $aRpl[$_SERVER['DOCUMENT_ROOT']] = '${DocumentRoot}';
        $aRpl[str_replace('/', DIRECTORY_SEPARATOR, $_SERVER['DOCUMENT_ROOT'])] = '${DocumentRoot}';
        $aRpl[PRADO_DIR . DIRECTORY_SEPARATOR] = '${PradoFramework}' . DIRECTORY_SEPARATOR;
        if (isset($aRpl[DIRECTORY_SEPARATOR])) {
            unset($aRpl[DIRECTORY_SEPARATOR]);
        }
        $aRpl = array_reverse($aRpl, true);
        return str_replace(array_keys($aRpl), $aRpl, $value);
    }