From: hickert Date: Fri, 7 Oct 2005 06:19:28 +0000 (+0000) Subject: Added magic_quotes fix for Profile X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=37b9ba6c41c1a84cbbd4da1b57e9af9667743e4d;p=gosa.git Added magic_quotes fix for Profile git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1523 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiProfile.inc b/plugins/admin/fai/class_faiProfile.inc index 4b2d26df9..5ca3329b1 100644 --- a/plugins/admin/fai/class_faiProfile.inc +++ b/plugins/admin/fai/class_faiProfile.inc @@ -170,11 +170,18 @@ class faiProfile extends plugin $smarty->assign("divlisthead" ,$listhead); $smarty->assign("divlist" ,$divlist->DrawList()); - /* Assign variables */ + /* Magic quotes GPC, escapes every ' " \, to solve some security risks + * If we post the escaped strings they will be escaped again + */ foreach($this->attributes as $attrs){ - $smarty->assign($attrs,$this->$attrs); + if(get_magic_quotes_gpc()){ + $smarty->assign($attrs,stripslashes($this->$attrs)); + }else{ + $smarty->assign($attrs,($this->$attrs)); + } } + $display.= $smarty->fetch(get_template_path('faiProfile.tpl', TRUE)); return($display); } diff --git a/plugins/admin/fai/class_faiProfileEntry.inc b/plugins/admin/fai/class_faiProfileEntry.inc index b38614e3b..24298a312 100644 --- a/plugins/admin/fai/class_faiProfileEntry.inc +++ b/plugins/admin/fai/class_faiProfileEntry.inc @@ -117,9 +117,15 @@ class faiProfileEntry extends plugin $objTypes['FAIpackages'] = " "; $objTypes['FAIpartitionTable'] = " "; - /* assign basic attributes */ + /* Magic quotes GPC, escapes every ' " \, to solve some security risks + * If we post the escaped strings they will be escaped again + */ foreach($this->attributes as $attrs){ - $smarty->assign($attrs,stripslashes($this->$attrs)); + if(get_magic_quotes_gpc()){ + $smarty->assign($attrs,stripslashes($this->$attrs)); + }else{ + $smarty->assign($attrs,($this->$attrs)); + } } /* Assign all filter attributes to smarty */