diff options
author | MaZderMind | 2015-11-06 12:17:41 +0100 |
---|---|---|
committer | MaZderMind | 2015-11-06 12:17:41 +0100 |
commit | e84ce4fea6b18ac72243e87e159d37e6cdffae04 (patch) | |
tree | 24c2067ba110a084d02f5fe478a6e626e1fb6fd8 /model/Room.php | |
parent | 596323d5a4926d697ec75381fb3bf20fd3117a64 (diff) |
fail when a roomslug contains invalid characters
Diffstat (limited to 'model/Room.php')
-rw-r--r-- | model/Room.php | 3 |
1 files changed, 3 insertions, 0 deletions
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); |