From 3052a6f0325d4ff8366f43e997ce43448e811f41 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 20 Oct 2013 12:14:44 +0200 Subject: [PATCH] Disallowed . and .. as tag --- src/Models/Model_Tag.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Models/Model_Tag.php b/src/Models/Model_Tag.php index 3d1a609f..1cf64662 100644 --- a/src/Models/Model_Tag.php +++ b/src/Models/Model_Tag.php @@ -40,6 +40,9 @@ class Model_Tag extends RedBean_SimpleModel if (!preg_match('/^[a-zA-Z0-9_.-]+$/i', $tag)) throw new SimpleException('Invalid tag "' . $tag . '"'); + if (preg_match('/^\.\.?$/', $tag)) + throw new SimpleException('Invalid tag "' . $tag . '"'); + return $tag; }