// Copyright 2025 Patial Tech (Ankit Patial). // // This file is part of code.patial.tech/go/appcore, which is MIT licensed. // See http://opensource.org/licenses/MIT package open import ( "errors" "strings" ) // validateAppName validates application names on macOS func validateAppName(appName string) error { if appName == "" { return errors.New("application name cannot be empty") } // Check for suspicious characters that could be used for command injection dangerous := []string{";", "|", "&", "$", "`", "\n", "\r", "$(", "&&", "||"} for _, char := range dangerous { if strings.Contains(appName, char) { return errors.New("application name contains invalid characters") } } return nil }