VersionPress\Utils\QueryLanguageUtils::escapeGitLogArgument PHP Méthode

escapeGitLogArgument() private static méthode

private static escapeGitLogArgument ( string $value ) : string | null
$value string The value to be escaped
Résultat string | null
    private static function escapeGitLogArgument($value)
    {
        // https://regex101.com/r/yP4yN9/3
        // https://regex101.com/r/yM9wA2/3
        // https://regex101.com/r/fM7uL3/1
        $regex = ['/(\\\\|\\$)/', '/(\\.|\\[)/', '/(\\*)/'];
        $replacements = ['\\\\\\\\\\\\$1', '\\\\$1', '.$1'];
        return preg_replace($regex, $replacements, $value);
    }