From 47aa0b97e9fb3a499a17e9431d34635b5ae5042f Mon Sep 17 00:00:00 2001 From: Sebastian Riedel Date: Sun, 16 Aug 2009 14:45:51 +0200 Subject: [PATCH] only allow word characters in script names --- Changes | 1 + lib/Mojo/Scripts.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 9719f21837..bb3492fc8a 100644 --- a/Changes +++ b/Changes @@ -78,6 +78,7 @@ This file documents the revision history for Perl extension Mojo. - Fixed cloning of urls with base in Mojo::URL. - Fixed parsing of multiple headers and cookies with same name. - Fixed pipeline support in Mojo::Client. (acajou) + - Fixed Mojo::Scripts to only allow word characters in script names. 0.991246 2009-08-01 00:00:00 - Fixed typo. diff --git a/lib/Mojo/Scripts.pm b/lib/Mojo/Scripts.pm index 207eb7888a..3020ad0cab 100644 --- a/lib/Mojo/Scripts.pm +++ b/lib/Mojo/Scripts.pm @@ -27,7 +27,7 @@ sub run { my ($self, $name, @args) = @_; # Run script - if ($name && ($name ne 'help' || $args[0])) { + if ($name && $name =~ /^\w+$/ && ($name ne 'help' || $args[0])) { # Help? my $help = $name eq 'help' ? 1 : 0;