From e84ce4fea6b18ac72243e87e159d37e6cdffae04 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Fri, 6 Nov 2015 12:17:41 +0100 Subject: fail when a roomslug contains invalid characters --- model/Room.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/model/Room.php b/model/Room.php index e282b0b..6e37043 100644 --- a/model/Room.php +++ b/model/Room.php @@ -6,6 +6,9 @@ class Room extends ModelBase public function __construct($slug) { + if(preg_match('/[^a-z0-9_\-]/i', $slug)) + throw new Exception('Room Slug contains invalid Characters: "'.$slug.'"'); + if(! $this->has('ROOMS.'.$slug)) throw new NotFoundException('Room '.$slug); -- cgit v1.2.3