From 1541aa75a2df69da2fcd3410fcf56a3b3f0ad00c Mon Sep 17 00:00:00 2001 From: Andrii Vasyliev Date: Sun, 15 Nov 2015 05:26:27 +0000 Subject: [PATCH] fixed PackageGoal::defaultNamespace to be more strict --- src/goals/PackageGoal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/goals/PackageGoal.php b/src/goals/PackageGoal.php index 806b53b..e7f9b8a 100644 --- a/src/goals/PackageGoal.php +++ b/src/goals/PackageGoal.php @@ -63,7 +63,7 @@ public function getNamespace() public static function defaultNamespace($vendor, $package) { - return $vendor . '\\' . strtr($package, '-', '\\'); + return preg_replace('/[^a-zA-Z0-9\\\\]+/', '', $vendor . strtr("-$package", '-', '\\')); } public function getSrc()