diff options
author | Fbenas <philbeansburton@gmail.com> | 2014-05-15 21:58:44 +0100 |
---|---|---|
committer | Fbenas <philbeansburton@gmail.com> | 2014-05-15 21:58:44 +0100 |
commit | 60cc569faaa2dc9eb12172cfaf6a8803d84f402f (patch) | |
tree | e11339dbf9559b2f7cbd45f3496f8dc1f13d7d14 /Blatech.php | |
parent | d548ec34e44dcc59bbd851ff76059f84a1eb2cf7 (diff) |
Sanitised inputs mofo!
Diffstat (limited to 'Blatech.php')
-rw-r--r-- | Blatech.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Blatech.php b/Blatech.php index c1b477e..701f2c2 100644 --- a/Blatech.php +++ b/Blatech.php @@ -32,6 +32,9 @@ class Blatech */ public function runCommand($message, $args) { + // Sanitise arguments + $args = static::sanitiseArgs($args); + var_dump($args); $nick = ltrim(explode('!', $message[0])[0],":"); $channel = $message[2]; @@ -59,4 +62,9 @@ class Blatech } } } + + private static function sanitiseArgs($string) + { + return preg_replace('/[^a-z\d_+:@#~!?\\/"\'£$%^*(){}\-\][=,.< >]/iu', '', $string); + } } |