From ece924111b4f5675d45236b410062e54ecd3d827 Mon Sep 17 00:00:00 2001 From: robocoder <anthon.pang@gmail.com> Date: Mon, 12 Jul 2010 16:25:35 +0000 Subject: [PATCH] refs r2462, refs r2470 git-svn-id: http://dev.piwik.org/svn/trunk@2476 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- core/Loader.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/Loader.php b/core/Loader.php index b6d24e2b7b..88b2c37585 100644 --- a/core/Loader.php +++ b/core/Loader.php @@ -25,9 +25,15 @@ class Piwik_Loader * * @param string $class Class name * @return string Class file name + * @throws Exception if class name is invalid */ protected static function getClassFileName($class) { + if(strspn($class, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_') !== strlen($class)) + { + throw new Exception("Invalid class name \"$class\"."); + } + $class = str_replace('_', '/', $class); if($class == 'Piwik') -- GitLab