From e5512bbf3f588c36d1bb4de680c0260013132baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 20 Oct 2010 13:56:47 +0000 Subject: [PATCH] =?UTF-8?q?Securityfix=20-=20XSS=20L=C3=BCcke=20in=20LV-Pl?= =?UTF-8?q?an=20behoben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/lvplan/stpl_week.php | 2 ++ include/functions.inc.php | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/cis/private/lvplan/stpl_week.php b/cis/private/lvplan/stpl_week.php index a9116ff55..67abf3bd7 100644 --- a/cis/private/lvplan/stpl_week.php +++ b/cis/private/lvplan/stpl_week.php @@ -151,6 +151,8 @@ if(strlen($grp)>2) die('Gruppe ist ungueltig'); if(isset($datum) && !is_numeric($datum)) die('Datum ist ungueltig'); +if(!check_ort($ort_kurzbz)) + die('Ort ist ungueltig'); $berechtigung=new benutzerberechtigung(); $berechtigung->getBerechtigungen($uid); diff --git a/include/functions.inc.php b/include/functions.inc.php index 253234ff5..5b915d259 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -58,6 +58,18 @@ function check_stsem($stsem) return preg_match('/^[WS][S][0-9]{4}$/', $stsem); } +/** + * Prueft ob die ort_kurzbz ein gueltiges Format hat + * @param $ort_kurzbz Kurzbezeichnung eines Ortes + */ +function check_ort($ort_kurzbz) +{ + if(preg_match('/^[A-Za-z0-9_.\-]{0,16}$/', $ort_kurzbz)) + return true; + else + return false; +} + function check_lektor($uid) { $db = new basis_db();