Reject custom namespace with number from 0 to 999

This commit is contained in:
René Pfeuffer
2020-09-07 15:33:01 +02:00
parent 4148bc4ee9
commit 503933c1c0

View File

@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package sonia.scm.repository;
import sonia.scm.plugin.Extension;
@@ -37,7 +37,7 @@ public class CustomNamespaceStrategy implements NamespaceStrategy {
doThrow()
.violation("invalid namespace", "namespace")
.when(!ValidationUtil.isRepositoryNameValid(namespace));
.when(!ValidationUtil.isRepositoryNameValid(namespace) || namespace.matches("[0-9]{1,3}"));
return namespace;
}