From: hickert Date: Tue, 30 Jun 2009 11:17:51 +0000 (+0000) Subject: Fixed ppd upload. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9b77ccc2afdcc507f0157079e8533fe326ee2c06;p=gosa.git Fixed ppd upload. -Special chars broke the upload process. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13845 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/ppd/class_printerPPDDialog.inc b/gosa-plugins/goto/admin/systems/ppd/class_printerPPDDialog.inc index be43f441a..3da4d8548 100644 --- a/gosa-plugins/goto/admin/systems/ppd/class_printerPPDDialog.inc +++ b/gosa-plugins/goto/admin/systems/ppd/class_printerPPDDialog.inc @@ -277,7 +277,7 @@ class printerPPDDialog extends plugin /* Get Description from ppd, & parse out some informations */ $ppdDesc = @$this->ppdManager->loadDescription($_PathOnHdd); if($ppdDesc){ - $name = $ppdDesc['name']; + $name = preg_replace("/\//","-",$ppdDesc['name']); $vendor = $ppdDesc['manufacturer']; $model = $ppdDesc['model']; } @@ -302,8 +302,9 @@ class printerPPDDialog extends plugin /* Check if this ppd already exists */ $found = false; + foreach($this->ppdList[$vendor] as $key => $val){ - if(preg_match("/".$model.".*/i",$key)){ + if(preg_match("/".preg_quote($model,'/').".*/i",$key)){ $found = true; if(!$overwrite){ if(!copy($_PathOnHdd,$_PathOnHdd."_back")){ @@ -366,7 +367,7 @@ class printerPPDDialog extends plugin /* Sort all available files, and create header (Vendor index) */ foreach($tmp as $file=>$ppd){ - if(preg_match("#".$this->pathToModified."#",$file)) continue; + if(preg_match("#".preg_quote($this->pathToModified,'#')."#",$file)) continue; if(!isset($this->ppdListHeader[$ppd['manufacturer']])){ $this->ppdListHeader[$ppd['manufacturer']]=0;