summaryrefslogtreecommitdiff
path: root/Blatech.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2014-05-15 21:58:44 +0100
committerFbenas <philbeansburton@gmail.com>2014-05-15 21:58:44 +0100
commit60cc569faaa2dc9eb12172cfaf6a8803d84f402f (patch)
treee11339dbf9559b2f7cbd45f3496f8dc1f13d7d14 /Blatech.php
parentd548ec34e44dcc59bbd851ff76059f84a1eb2cf7 (diff)
Sanitised inputs mofo!
Diffstat (limited to 'Blatech.php')
-rw-r--r--Blatech.php8
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);
+ }
}