Code

Removed a couple of normalize_preg calls
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 31 Oct 2008 15:53:01 +0000 (15:53 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 31 Oct 2008 15:53:01 +0000 (15:53 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12851 594d385d-05f5-0310-b6e9-bd551577e9d8

47 files changed:
gosa-core/plugins/admin/departments/class_departmentGeneric.inc
gosa-core/plugins/admin/users/class_userManagement.inc
gosa-core/setup/class_setupStep_Migrate.inc
gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc
gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc
gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc
gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc
gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc
gosa-plugins/fai/admin/fai/class_FAI.inc
gosa-plugins/fai/admin/fai/class_faiHook.inc
gosa-plugins/fai/admin/fai/class_faiManagement.inc
gosa-plugins/fai/admin/fai/class_faiPackage.inc
gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
gosa-plugins/fai/admin/fai/class_faiProfile.inc
gosa-plugins/fai/admin/fai/class_faiScript.inc
gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc
gosa-plugins/fai/admin/fai/class_faiTemplate.inc
gosa-plugins/fai/admin/fai/class_faiVariable.inc
gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc
gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc
gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc
gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc
gosa-plugins/goto/admin/applications/class_applicationGeneric.inc
gosa-plugins/goto/admin/applications/class_applicationManagement.inc
gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc
gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc
gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc
gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc
gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc
gosa-plugins/goto/admin/systems/goto/class_terminalService.inc
gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc
gosa-plugins/goto/admin/systems/goto/class_workstationService.inc
gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc
gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc
gosa-plugins/log/addons/logview/class_gosa_logview.inc
gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc
gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc
gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc
gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc
gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc
gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc
gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc
gosa-plugins/systems/admin/systems/class_componentGeneric.inc
gosa-plugins/systems/admin/systems/class_servGeneric.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc
gosa-plugins/systems/admin/systems/class_termDNS.inc

index d256d7a682eaf35e1f4c298af984d5a2bbbc2fd9..27ad5c002bd9f29a56a6d8104ad5d8a94aec92b6 100644 (file)
@@ -467,7 +467,7 @@ class department extends plugin
                    }
 
                    /* This one matches with the latter part. Break and don't fix this entry */
-                   if (preg_match('/(^|,)'.normalizePreg($key).'$/', $attrs['dn'])){
+                   if (preg_match('/(^|,)'.preg_quote($key).'$/', $attrs['dn'])){
                            $fix= false;
                            break;
                    }
@@ -629,7 +629,7 @@ class department extends plugin
           }
 
           /* This one matches with the latter part. Break and don't fix this entry */
-          if (preg_match('/(^|,)'.normalizePreg($key).'$/', $dn)){
+          if (preg_match('/(^|,)'.preg_quote($key).'$/', $dn)){
             @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, "DEBUG: Possibly relevant: $key", "Tagging");
             $relevant[strlen($key)]= $ntag;
             continue;
index 3cafa82664b88a07973703976789b872900a05d0..35c12d1516bd241131227b59484d17b14e3ee7c7 100644 (file)
@@ -921,7 +921,7 @@ class userManagement extends plugin
       $this->usertab->givenName = $this->givenName;
       $template_dn              = $_POST['template'];
       $this->usertab->adapt_from_template($template_dn);
-      $template_base            = preg_replace("/^[^,]+,".normalizePreg(get_people_ou())."/", '', $template_dn);
+      $template_base            = preg_replace("/^[^,]+,".preg_quote(get_people_ou())."/", '', $template_dn);
       $this->usertab->by_object['user']->base= $template_base;
     }
    
@@ -1059,7 +1059,7 @@ class userManagement extends plugin
       /* Skip entries that are not located under the people ou (normaly 'ou=people,')
        * Else winstations will be listed too, if you use the subtree flag. 
        */
-      if(!preg_match("/".normalizePreg(get_people_ou())."/i",$Entry['dn'])){
+      if(!preg_match("/".preg_quote(get_people_ou())."/i",$Entry['dn'])){
         continue;
       }else{
 
index 9de097644c1a9d0bb6c1eb4940a77f1c7b0346be..70fb3b4f2fcd8149ea8880c4a0d9551e5b071505 100644 (file)
@@ -345,7 +345,7 @@ class Step_Migrate extends setup_step
 
     $this->outside_winstations = array();
     while($attrs = $ldap->fetch()){
-      if((!preg_match("/^[^,]+,".normalizePreg($winstation_ou)."/",$attrs['dn'])) && !preg_match("/,dc=addressbook,/",$attrs['dn'])){
+      if((!preg_match("/^[^,]+,".preg_quote($winstation_ou)."/",$attrs['dn'])) && !preg_match("/,dc=addressbook,/",$attrs['dn'])){
         $attrs['selected'] = FALSE;
         $attrs['ldif']     = "";
         $this->outside_winstations[base64_encode($attrs['dn'])] = $attrs;
@@ -410,12 +410,12 @@ class Step_Migrate extends setup_step
     $this->outside_groups = array();
     $this->groups_list = array();;
     while($attrs = $ldap->fetch()){
-      $group_db_base = preg_replace("/^[^,]+,".normalizePreg($group_ou)."+,/i","",$attrs['dn']);
+      $group_db_base = preg_replace("/^[^,]+,".preg_quote($group_ou)."+,/i","",$attrs['dn']);
 
       /* Check if entry is not an addressbook only user
        *  and verify that he is in a valid department
        */
-      if( !preg_match("/".normalizePreg("dc=addressbook,")."/",$group_db_base) &&
+      if( !preg_match("/".preg_quote("dc=addressbook,")."/",$group_db_base) &&
           !in_array($group_db_base,$valid_deps)
         ){
         $attrs['selected'] = FALSE;
@@ -488,12 +488,12 @@ class Step_Migrate extends setup_step
     }
 
     while($attrs = $ldap->fetch()){
-      $people_db_base = preg_replace("/^[^,]+,".normalizePreg($people_ou)."/i","",$attrs['dn']);
+      $people_db_base = preg_replace("/^[^,]+,".preg_quote($people_ou)."/i","",$attrs['dn']);
 
       /* Check if entry is not an addressbook only user
        *  and verify that he is in a valid department
        */
-      if( !preg_match("/".normalizePreg("dc=addressbook,")."/",$people_db_base) &&
+      if( !preg_match("/".preg_quote("dc=addressbook,")."/",$people_db_base) &&
           !in_array($people_db_base,$valid_deps)
          ){
         $attrs['selected'] = FALSE;
index 369acd0dd866a9476c0fb340401f793fb9dfdf89..fd3304b082ad4a0ebaa68b4f1bb6f231bf5c3f29 100644 (file)
@@ -787,8 +787,8 @@ class addressbook extends plugin
     $acls = "";
   
     /* Use addressbook acls */
-    if(preg_match("/".normalizePreg($this->abobjectclass)."/",$dn))  {
-      $dn = preg_replace("/".normalizePreg($this->abobjectclass).",/","",$dn);
+    if(preg_match("/".preg_quote($this->abobjectclass)."/",$dn))  {
+      $dn = preg_replace("/".preg_quote($this->abobjectclass).",/","",$dn);
       $acls = $this->ui->get_permissions($dn,"addressbook/addressbook",$attr);
     }
     
index 1a2222230f5d784440e3e16300662ae4fbf63150..1b5201d24043e060f5351f88ce47a33003c021de 100644 (file)
@@ -438,7 +438,7 @@ class servdhcp extends goService
     foreach ($this->dhcpObjectCache as $dn => $data){
 
       if($this->dn != $this->orig_dn){
-        $dn = preg_replace("/".normalizePreg($this->orig_dn)."$/i",$this->dn,$dn);
+        $dn = preg_replace("/".preg_quote($this->orig_dn)."$/i",$this->dn,$dn);
       }
 
       /* Remove entry? */
@@ -492,7 +492,7 @@ class servdhcp extends goService
       
           if(in_array($attribute,array("dhcpPrimaryDN","dhcpSecondaryDN","dhcpServerDN","dhcpFailOverPeerDN"))){
             foreach($values as $v_key => $value){
-              $values[$v_key] = preg_replace("/".normalizePreg($this->orig_dn)."$/i",$this->dn,$value);
+              $values[$v_key] = preg_replace("/".preg_quote($this->orig_dn)."$/i",$this->dn,$value);
             }
           }
 
@@ -542,7 +542,7 @@ class servdhcp extends goService
 
     $this->dhcpServiceDN= $this->serviceDN;
     if($this->dn != $this->orig_dn){
-      $this->dhcpServiceDN= preg_replace("/".normalizePreg($this->orig_dn)."$/i",$this->dn,$this->dhcpServiceDN);
+      $this->dhcpServiceDN= preg_replace("/".preg_quote($this->orig_dn)."$/i",$this->dn,$this->dhcpServiceDN);
     }
 
     /* Replace 'new' dn */ 
@@ -720,7 +720,7 @@ class servdhcp extends goService
     while($attrs = $ldap->fetch()){
 
       /* Skip own config */
-      if($this->dn != "new" && preg_match("/".normalizePreg($this->dn)."$/",$attrs['dn'])){
+      if($this->dn != "new" && preg_match("/".preg_quote($this->dn)."$/",$attrs['dn'])){
         continue;
       }
 
index af7994697441a997990e35ca91a0e07af30f2187..205e3320912083d901fbaa9bd8b5e7416f8fa39f 100644 (file)
@@ -363,8 +363,8 @@ class DNS
          */
         $zN = trim($zone,".");
         $nN = trim($name,".");  
-        if(preg_match("/".normalizePreg($zN)."$/",$nN)){
-          $nN = preg_replace("/[\.]*".normalizePreg($zN)."[\.]*$/","",$nN);
+        if(preg_match("/".preg_quote($zN)."$/",$nN)){
+          $nN = preg_replace("/[\.]*".preg_quote($zN)."[\.]*$/","",$nN);
         }else{
           $nN = $name;
         }
@@ -399,7 +399,7 @@ class DNS
 
       /* Check given host name with zone settings 
        */ 
-      if(preg_match("/".normalizePreg($testname)."[\.]*$/",$nN) || $attrs['relativeDomainName'][0] == $name){
+      if(preg_match("/".preg_quote($testname)."[\.]*$/",$nN) || $attrs['relativeDomainName'][0] == $name){
         $ret['exists'] = true;
         $ret['zoneName'] = $id_tmp;
         foreach(array("dNSClass","dNSTTL") as $atr){
@@ -463,8 +463,8 @@ class DNS
     $zN = trim($zoneName,".");
     $nN = trim($newName,".");
     $oN = trim($oldName,".");
-    $newName = preg_replace("/[\.]*".normalizePreg($zN)."$/i","",$nN);
-    $oldName = preg_replace("/[\.]*".normalizePreg($zN)."$/i","",$oN);
+    $newName = preg_replace("/[\.]*".preg_quote($zN)."$/i","",$nN);
+    $oldName = preg_replace("/[\.]*".preg_quote($zN)."$/i","",$oN);
 
     /* If reverseZone can't be resolved ... this 
      *  can't be a valid entry, so remove this account
index bd90bd28d5b70bf3c9d38c05bec8134f34ace8f2..aa9722b108ded139fca7c07a96b96142702bdd0c 100644 (file)
@@ -61,7 +61,7 @@ class servdns extends goService
     $dns = array();
     while($attrs = $ldap->fetch()){
       /* Skip own config */
-      if($this->dn != "new" && preg_match("/".normalizePreg($this->dn)."$/",$attrs['dn'])){
+      if($this->dn != "new" && preg_match("/".preg_quote($this->dn)."$/",$attrs['dn'])){
         continue;
       }
       $dn = preg_replace("/^zoneName=[^,]+,/","",$attrs['dn']);
@@ -398,7 +398,7 @@ class servdns extends goService
       $ldap->ls("(objectClass=dnsZone)",$src,array('cn'));
       while($attrs = $ldap->fetch()){
         $src_zone = $attrs['dn'];
-        $dst_zone = preg_replace("/".normalizePreg($src)."$/",$this->dn,$src_zone);
+        $dst_zone = preg_replace("/".preg_quote($src)."$/",$this->dn,$src_zone);
         $res = plugin::recursive_move($src_zone, $dst_zone);
 
         if($res){
@@ -435,7 +435,7 @@ class servdns extends goService
     foreach($tmp as $key1 => $data1){
       $tmp2[$key1] = array();
       foreach($data1 as $key2 => $data2){
-        $tmp2[$key1][preg_replace("/".normalizePreg($old_dn)."$/",$this->dn,$key2)] = $data2;
+        $tmp2[$key1][preg_replace("/".preg_quote($old_dn)."$/",$this->dn,$key2)] = $data2;
       }
     }
     $tmp = $tmp2;
index 160790fab921c9626727f1ee1e87bbfb5a402407..b5854fc9d780e888160481691f294e34e49a8ff6 100644 (file)
@@ -91,7 +91,7 @@ class servdnseditZone extends plugin
             $tmp2[$tmp[0]] = $rec;
             unset($this->Records[$key]);
           }
-          if($rec['type'] == "nSRecord" && preg_match("/".normalizePreg($this->sOAprimary)."/",$rec['value'])){
+          if($rec['type'] == "nSRecord" && preg_match("/".preg_quote($this->sOAprimary)."/",$rec['value'])){
             unset($this->Records[$key]);
           }
         }
index 78b9be741e3819c429ec63295341b81302612168..59cab870136f24026f8cd9ceae52de3d6c9d2517 100644 (file)
@@ -170,7 +170,7 @@ class servDNSeditZoneEntries extends plugin
             $found = false;
             $ip = $value;
             $match = preg_replace("/^[^\/]*+\//","",$this->reverseName);
-            $ip = preg_replace("/^".normalizePreg($match)."/","",$ip);
+            $ip = preg_replace("/^".preg_quote($match)."/","",$ip);
             $ip = preg_replace("/^\./","",$ip);
 
             foreach($this->Devices[$Name]['RECORDS'] as $key => $dev){
index e6e191814e596b3526b6b555fe3791ef98acc9b3..677a8b925e8b4c6ba33bc06dec7ac4e9a31fcbdf 100644 (file)
@@ -70,7 +70,7 @@ class FAI
         foreach($res_tmp as $attr){
 
           $buffer = array();
-          $name = preg_replace("/".normalizePreg($release)."/i","",$attr['dn']);
+          $name = preg_replace("/".preg_quote($release)."/i","",$attr['dn']);
 
           if(isset($attr['FAIstate'][0])){
             if(preg_match("/removed$/",$attr['FAIstate'][0])){
@@ -83,7 +83,7 @@ class FAI
 
           /* Seems to be an inherited class, apply current FAIstate to this classes 
            */
-          if(!preg_match("/".normalizePreg($base_release)."$/i",$attr['dn'])){
+          if(!preg_match("/".preg_quote($base_release)."$/i",$attr['dn'])){
             $buffer['FAIstate'] = $FAIstate; 
           }else{
 
@@ -151,7 +151,7 @@ class FAI
   {
     global $config;
 
-    if(!preg_match("/".normalizePreg(get_ou('faiBaseRDN'))."/",$dn)){
+    if(!preg_match("/".preg_quote(get_ou('faiBaseRDN'))."/",$dn)){
       $base = get_ou('faiBaseRDN').$dn;
     }else{
       $base = $dn;
@@ -163,7 +163,7 @@ class FAI
     $ldap->search("(objectClass=FAIbranch)",array("ou","dn"));
     while($attrs = $ldap->fetch()){
       if($appendedName){
-        $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".normalizePreg(get_ou('faiBaseRDN')).".*$/","",$attrs['dn']));
+        $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".preg_quote(get_ou('faiBaseRDN')).".*$/","",$attrs['dn']));
       }else{
         $res[$attrs['dn']] = $attrs['ou'][0];
       }
@@ -207,7 +207,7 @@ class FAI
 
       /* Dont't try to modify non FAIclasses  
        */
-      if(!preg_match("/[^,]+,".normalizePreg(get_ou("faiBaseRDN"))."/",$obj_dn)){
+      if(!preg_match("/[^,]+,".preg_quote(get_ou("faiBaseRDN"))."/",$obj_dn)){
         trigger_error("PLEASE check fai class handling in ".__LINE__." -> ".__FILE__);        
         echo "<br>-->".$Current_DN."<br>";
         echo "<br>-->".$obj_dn."<br>";
@@ -247,8 +247,8 @@ class FAI
 
               /* Check if this Profile uses the source class ($cn)
                */
-              if(preg_match("/".normalizePreg($cn)."/",$attrs['FAIclass'])){
-                $attrs['FAIclass'] = preg_replace("/[ ]*".normalizePreg($cn)."[ ]*/i"," ",$attrs['FAIclass']);
+              if(preg_match("/".preg_quote($cn)."/",$attrs['FAIclass'])){
+                $attrs['FAIclass'] = preg_replace("/[ ]*".preg_quote($cn)."[ ]*/i"," ",$attrs['FAIclass']);
                 if(empty($attrs['FAIclass'])){
                   $attrs['FAIclass'] = array();
                 }
@@ -595,7 +595,7 @@ class FAI
 
           $buffer = array();
 #        $name = str_ireplace($release,"",$attr['dn']);
-          $name = preg_replace("/".normalizePreg($release)."/i","",$attr['dn']);
+          $name = preg_replace("/".preg_quote($release)."/i","",$attr['dn']);
 
           if(isset($attr['FAIstate'][0])&&(preg_match("/removed$/",$attr['FAIstate'][0]))){
 
@@ -703,7 +703,7 @@ class FAI
 
     /* Get dn suffix. Example  "FAIvairableEntry=keksdose,FAIvariable=Keksregal," */
 #  $dn_suffix = str_ireplace($base_release,"",$dn);
-    $dn_suffix = preg_replace("/".normalizePreg($base_release)."/i","",$dn);
+    $dn_suffix = preg_replace("/".preg_quote($base_release)."/i","",$dn);
 
     /* Check if given object also exists whitin one of these releases */
     foreach($sub_releases as $p_release => $name){
@@ -744,7 +744,7 @@ class FAI
 
     /* Get dn suffix. Example  "FAIvairableEntry=keksdose,FAIvariable=Keksregal," */
 #  $dn_suffix = str_ireplace($base_release,"",$dn);
-    $dn_suffix = preg_replace("/".normalizePreg($base_release)."/i","",$dn);
+    $dn_suffix = preg_replace("/".preg_quote($base_release)."/i","",$dn);
 
     /* Check if given object also exists whitin one of these releases */
     foreach($previous_releases as $p_release){
@@ -768,7 +768,7 @@ class FAI
     $ret = array();
 
     /* Explode dns into pieces, to be able to build parent dns */
-    $dns_to_check = gosa_ldap_explode_dn(preg_replace("/".normalizePreg(",".$config->current['BASE'])."/i","",$dn));
+    $dns_to_check = gosa_ldap_explode_dn(preg_replace("/".preg_quote(",".$config->current['BASE'])."/i","",$dn));
 
     if(!is_array($dns_to_check)){
       return;  
@@ -902,7 +902,7 @@ class FAI
     $ldap->search("(objectClass=FAIbranch)",array("ou","FAIstate"));
     while($attrs = $ldap->fetch()){
       foreach($sub_releases as $sub_rel){
-        if(preg_match("/^".normalizePreg($sub_rel.get_ou('faiBaseRDN'))."/",$attrs['dn'])){
+        if(preg_match("/^".preg_quote($sub_rel.get_ou('faiBaseRDN'))."/",$attrs['dn'])){
           $f_releases[$sub_rel.get_ou('faiBaseRDN')] = $attrs;
         }
       }
@@ -979,7 +979,7 @@ class FAI
     }else{
       $source_dns = array();
       foreach($g_releases as $dn => $data){
-        if(preg_match("/^".normalizePreg($source_dn)."/",$dn)){
+        if(preg_match("/^".preg_quote($source_dn)."/",$dn)){
           $source_dns[$dn] = $data; 
         }
       }
@@ -992,7 +992,7 @@ class FAI
       $ldap->cd($dn);
       $ldap->ls("(|(objectClass=gotoSubmenuEntry)(objectClass=gotoMenuEntry))",$dn,array("dn"));
       while($attrs = $ldap->fetch()){
-        $destination = preg_replace("/".normalizePreg($dn)."$/","ou=".$destination_name.",".$dn,$attrs['dn']);
+        $destination = preg_replace("/".preg_quote($dn)."$/","ou=".$destination_name.",".$dn,$attrs['dn']);
         $to_copy[$attrs['dn']] = $destination;
       }
     }
@@ -1200,7 +1200,7 @@ class FAI
     $ldap->cd($config->current['BASE']);
 
     /* Split dn into pices */ 
-    $dns_to_check = gosa_ldap_explode_dn(preg_replace("/".normalizePreg(",".$config->current['BASE'])."/i","",$Current_DN));
+    $dns_to_check = gosa_ldap_explode_dn(preg_replace("/".preg_quote(",".$config->current['BASE'])."/i","",$Current_DN));
 
     if(!is_array($dns_to_check)){
       return;  
index 5753521c68310288c0de6ec92d391efbbc619683..5005cce1563c607489a25d89f0cc462699ff753c 100644 (file)
@@ -50,7 +50,7 @@ class faiHook extends plugin
       foreach($res as $obj){
 
         /* Skip not relevant objects */
-        if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
+        if(!preg_match("/".preg_quote($this->dn)."$/i",$obj['dn'])) continue;
 
         $objects = array();
         $objects['status']      = "FreshLoaded";
@@ -399,12 +399,12 @@ class faiHook extends plugin
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->dn);
       $release = $this->parent->parent->fai_release;
-      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+      $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
       new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
       FAI::prepare_to_save_FAI_object($use_dn,array(),true);
 
       foreach($this->SubObjects as $name => $obj){
-        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+        $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
       $this->handle_post_events("remove");
@@ -532,7 +532,7 @@ class faiHook extends plugin
     foreach($res as $obj){
 
       /* Skip not relevant objects */
-      if(!preg_match("/".normalizePreg($source['dn'])."$/i",$obj['dn'])) continue;
+      if(!preg_match("/".preg_quote($source['dn'])."$/i",$obj['dn'])) continue;
 
       $objects = array();
       $objects['status']      = "edited";
index adf9d12cbea4afa8ccfa715fa2455db30212d049..3114ba7fab802cecd5872d59e024a682e25975a0 100644 (file)
@@ -576,9 +576,9 @@ class faiManagement extends plugin
 
             $ldap->cd($bb);
             $ldap->recursive_remove();
-            $ldap->cd(preg_replace('/,'.normalizePreg(get_ou('faiBaseRDN')).'/', ','.get_ou('applicationRDN'), $bb));
+            $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN')).'/', ','.get_ou('applicationRDN'), $bb));
             $ldap->recursive_remove();
-            $ldap->cd(preg_replace('/,'.normalizePreg(get_ou('faiBaseRDN')).'/', ','.get_ou('mimetypeRDN'), $bb));
+            $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN')).'/', ','.get_ou('mimetypeRDN'), $bb));
             $ldap->recursive_remove();
 
             /* Search for all groups with configured application menus.
@@ -586,7 +586,7 @@ class faiManagement extends plugin
               - The search für menu configuration for the specified release and collect all those dns.
               - Remove entries
              */
-            $release_ou = preg_replace("/".normalizePreg(get_ou("faiBaseRDN")).".*$/","",$bb);
+            $release_ou = preg_replace("/".preg_quote(get_ou("faiBaseRDN")).".*$/","",$bb);
             $ldap->cd($this->config->current['BASE']);
             $ldap->search("(objectClass=posixGroup)",array("dn"));
           
@@ -604,7 +604,7 @@ class faiManagement extends plugin
               $ldap->cd($dn);
               $ldap->search("(objectClass=FAIbranch)",array("dn"));
               while($attrs = $ldap->fetch()){
-                if(preg_match("/^".normalizePreg($release_ou)."/",$attrs['dn'])){
+                if(preg_match("/^".preg_quote($release_ou)."/",$attrs['dn'])){
                   $dns[] = $attrs['dn'];
                 }
               }
@@ -728,11 +728,11 @@ class faiManagement extends plugin
           }
         }
 
-        $appsrc = preg_replace("/".normalizePreg(get_ou('faiBaseRDN'))."/",get_ou('applicationRDN'),$baseToUse); 
-        $appdst = preg_replace("/".normalizePreg(get_ou('faiBaseRDN'))."/",get_ou('applicationRDN'),"ou=".$name.",".$baseToUse) ; 
+        $appsrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'))."/",get_ou('applicationRDN'),$baseToUse); 
+        $appdst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'))."/",get_ou('applicationRDN'),"ou=".$name.",".$baseToUse) ; 
 
-        $mimesrc = preg_replace("/".normalizePreg(get_ou('faiBaseRDN'))."/",get_ou('mimetypeRDN'),$baseToUse); 
-        $mimedst = preg_replace("/".normalizePreg(get_ou('faiBaseRDN'))."/",get_ou('mimetypeRDN'),"ou=".$name.",".$baseToUse) ; 
+        $mimesrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'))."/",get_ou('mimetypeRDN'),$baseToUse); 
+        $mimedst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'))."/",get_ou('mimetypeRDN'),"ou=".$name.",".$baseToUse) ; 
 
         /* Check if source depeartments exist */
         foreach(array($baseToUse,$appsrc,$mimesrc) as $dep){
index 22c8637c07c0c0b564fb8ff1ad4855e749d94088..d62a5458c171324b0793d67c6146d48eac396d9e 100644 (file)
@@ -173,7 +173,7 @@ class faiPackage extends plugin
 
       /* Assemble release name */
       $release = $this->parent->parent->fai_release;
-      $tmp= preg_replace('/[,]*'.normalizePreg(get_ou('faiBaseRDN')).'.*$/', '', $release);
+      $tmp= preg_replace('/[,]*'.preg_quote(get_ou('faiBaseRDN')).'.*$/', '', $release);
       $tmp= preg_replace('/ou=/', '', $tmp);
       $rev= array_reverse(split(',', $tmp));
       $this->FAIdebianRelease= "/";
@@ -407,13 +407,13 @@ class faiPackage extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
     $release = $this->parent->parent->fai_release;
-    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+    $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
     FAI::prepare_to_save_FAI_object($use_dn,array(),true);
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
     foreach($this->ConfiguredPackages as $pkgname => $attrs){
       foreach($attrs as $name => $attr){
         $pkgdn =  "FAIvariable=".$name.",".$this->dn;
-        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $pkgdn);
+        $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $pkgdn);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
     }
@@ -495,7 +495,7 @@ class faiPackage extends plugin
     if($this->FAIdebianRelease == "ClearFromCopyPaste"){
 
       $current_release  = $this->parent->parent->fai_release;
-      $tmp= preg_replace('/,'.normalizePreg(get_ou('faiBaseRDN')).'.*$/', '', $current_release);
+      $tmp= preg_replace('/,'.preg_quote(get_ou('faiBaseRDN')).'.*$/', '', $current_release);
       $tmp= preg_replace('/ou=/', '', $tmp);
       $rev= array_reverse(split(',', $tmp));
       $this->FAIdebianRelease= "";
index eac75522a0ed88d522d730b979a4b4000e64d082..d83ae91b6c1306b8eb65b2a8ea914949b496652c 100644 (file)
@@ -42,7 +42,7 @@ class faiPartitionTable extends plugin
       foreach($res as $obj){
 
         /* Skip not relevant objects */
-        if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
+        if(!preg_match("/".preg_quote($this->dn)."$/i",$obj['dn'])) continue;
 
         $objects = array();
         $objects['description']  = "";
@@ -60,7 +60,7 @@ class faiPartitionTable extends plugin
         foreach($res as $obj){
 
           /* Skip not relevant objects */
-          if(!preg_match("/".normalizePreg($disk['dn'])."$/i",$obj['dn'])) continue;
+          if(!preg_match("/".preg_quote($disk['dn'])."$/i",$obj['dn'])) continue;
 
           $objects = array();
           $objects['status']      = "edited";
@@ -324,17 +324,17 @@ class faiPartitionTable extends plugin
     $ldap->cd ($this->dn);
 
     $release = $this->parent->parent->fai_release;
-    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+    $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
 
     FAI::prepare_to_save_FAI_object($use_dn,array(),true);
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);   
     foreach($this->disks as $disk){
       $disk_dn = "cn=".$disk['cn'].",".$this->dn;
-      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i",$release, $disk_dn);
+      $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i",$release, $disk_dn);
       FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       foreach($disk['partitions'] as $key => $partition){    
         $partition_dn= "FAIpartitionNr=".$partition['FAIpartitionNr'].",".$disk_dn;      
-        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $partition_dn);
+        $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $partition_dn);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
     }
@@ -502,7 +502,7 @@ class faiPartitionTable extends plugin
     foreach($res as $obj){
 
       /* Skip not relevant objects */
-      if(!preg_match("/".normalizePreg($source['dn'])."$/i",$obj['dn'])) continue;
+      if(!preg_match("/".preg_quote($source['dn'])."$/i",$obj['dn'])) continue;
 
       $objects = array();
       $objects['description']  = "";
@@ -520,7 +520,7 @@ class faiPartitionTable extends plugin
       foreach($res as $obj){
 
         /* Skip not relevant objects */
-        if(!preg_match("/".normalizePreg($disk['dn'])."$/i",$obj['dn'])) continue;
+        if(!preg_match("/".preg_quote($disk['dn'])."$/i",$obj['dn'])) continue;
 
         $objects = array();
         $objects['status']      = "edited";
index e6c007efbff6626a5674652118cbfa01f31926d2..9eca6ad6528a5e8ffdf63f358bfed6908801ec87 100644 (file)
@@ -364,7 +364,7 @@ class faiProfile extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
     $release = $this->parent->parent->fai_release;
-    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+    $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
     FAI::prepare_to_save_FAI_object($use_dn,array(),true);
     $this->handle_post_events("remove");    
index 7a480bbea4acc83676a45c10e9707fab401af1cb..a762beb54dee114183b6ef2fc0f68c3b98147fc5 100644 (file)
@@ -55,7 +55,7 @@ class faiScript extends plugin
       foreach($res as $obj){
 
         /* Skip not relevant objects */
-        if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
+        if(!preg_match("/".preg_quote($this->dn)."$/i",$obj['dn'])) continue;
 
         $objects = array();
         $objects['status']      = "FreshLoaded";
@@ -432,12 +432,12 @@ class faiScript extends plugin
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->dn);
       $release = $this->parent->parent->fai_release;
-      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+      $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
       new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
       FAI::prepare_to_save_FAI_object($use_dn,array(),true);
  
       foreach($this->SubObjects as $name => $obj){
-        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+        $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
       $this->handle_post_events("remove");
@@ -590,7 +590,7 @@ class faiScript extends plugin
     foreach($res as $obj){
 
       /* Skip not relevant objects */
-      if(!preg_match("/".normalizePreg($source['dn'])."$/i",$obj['dn'])) continue;
+      if(!preg_match("/".preg_quote($source['dn'])."$/i",$obj['dn'])) continue;
 
       $objects = array();
       $objects['status']      = "edited";
index 99e6043783299f6b674cfae43fc8813ef36fb672..6d6aa0b4250a4a788c58ed83f332bb9b7f29a137 100644 (file)
@@ -69,7 +69,7 @@ class faiSummaryTab extends plugin{
       /* Get Classes and release */
       $this->Classes = $this->parent->by_object['faiProfile']->FAIclasses;
       $this->base    = $this->parent->by_object['faiProfile']->parent->parent->fai_release;
-      $str = preg_replace("/^.*".normalizePreg(get_ou('faiProfileRDN'))."/","",$this->dn);
+      $str = preg_replace("/^.*".preg_quote(get_ou('faiProfileRDN'))."/","",$this->dn);
       $tmp  = $this->parent->by_object['faiProfile']->parent->parent->getBranches();
       $this->Release = $tmp[$this->base];
   
index f53314bda3a6daa2739b43a2cb0425d51f01a8a1..3bc50dd4a261643d3c366fc79f28387f1a383e12 100644 (file)
@@ -52,7 +52,7 @@ class faiTemplate extends plugin
       foreach($res as $obj){
 
         /* Skip not relevant objects */
-        if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
+        if(!preg_match("/".preg_quote($this->dn)."$/i",$obj['dn'])) continue;
 
         $objects = array();
         $objects['status']      = "FreshLoaded";
@@ -382,12 +382,12 @@ class faiTemplate extends plugin
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->dn);
       $release = $this->parent->parent->fai_release;
-      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+      $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
       new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
       FAI::prepare_to_save_FAI_object($use_dn,array(),true);
 
       foreach($this->SubObjects as $name => $obj){
-        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+        $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
       $this->handle_post_events("remove");
@@ -517,7 +517,7 @@ class faiTemplate extends plugin
     foreach($res as $obj){
 
       /* Skip not relevant objects */
-      if(!preg_match("/".normalizePreg($source['dn'])."$/i",$obj['dn'])) continue;
+      if(!preg_match("/".preg_quote($source['dn'])."$/i",$obj['dn'])) continue;
 
       $objects = array();
       $objects['status']      = "edited";
index 40ece132514c32bb34b116f27ba164e1ca17b31b..f8f1b3be44483430aeca053dce72cf9e50cab267 100644 (file)
@@ -257,12 +257,12 @@ class faiVariable extends plugin
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->dn);
       $release = $this->parent->parent->fai_release;
-      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+      $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
       new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
       FAI::prepare_to_save_FAI_object($use_dn,array(),true);
 
       foreach($this->SubObjects as $name => $obj){
-        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+        $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
       $this->handle_post_events("remove");
index f40e3cb71ab0cce6ed3cf3f0df79a3d97dc1026d..e0b758aafbbc4ff656d2bca05d3b8e39c722af53 100644 (file)
@@ -63,7 +63,7 @@ class phoneGeneric extends plugin
       $this->base= dn2base($ui->dn);
       $this->cn= "";
     } else {
-      $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("phoneRDN"))."/", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("phoneRDN"))."/", "", $this->dn);
     }
   
     if($this->goFonMSN != ""){
index 1c2e698aa645c238ea5e94fa352b83686dfa815e..899b2c231d9b850b5614dfe85b266a4b4ccd01cf 100644 (file)
@@ -119,7 +119,7 @@ class conference extends plugin
     } else {
 
       /* Get base */ 
-      $this->base = preg_replace ("/^[^,]+,".normalizePreg(get_ou('phoneConferenceRDN'))."/i","",$this->dn);;
+      $this->base = preg_replace ("/^[^,]+,".preg_quote(get_ou('phoneConferenceRDN'))."/i","",$this->dn);;
     }
 
     $this->goFonConferenceOwner=$this->ui->dn;
index 273e6853188ef3b8ce66ae16001e59a49c69488c..d9f2cf6ba57ccb821949d76fb5812eeb863fa02e 100644 (file)
@@ -63,7 +63,7 @@ class macro extends plugin
       }
     } else {
       $this->orig_cn=$this->cn;
-      $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("phoneMacroRDN"))."/i", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("phoneMacroRDN"))."/i", "", $this->dn);
     }
 
     /* Check server configurations
index 2d234439726f1f53b46467aaf77263fffbf17042..2176e776b63c367c75f5e4815535c1b00330aff5 100644 (file)
@@ -217,7 +217,7 @@ class phoneAccount extends plugin
       /* Skip all macros we are not able to read 
           execpt, the currently selected macro.
        */
-      if(!preg_match("/r/",$acl) && !preg_match("/^".normalizePreg($attrs['dn'])."/",$this->goFonMacro)){
+      if(!preg_match("/r/",$acl) && !preg_match("/^".preg_quote($attrs['dn'])."/",$this->goFonMacro)){
         continue;
       }
 
index 953f45a823a21adad40343c7fc1d3c7611df7755..f8364a09999fc3dd0ae42a310269a1fce468605c 100644 (file)
@@ -229,7 +229,7 @@ class application extends plugin
     restore_error_handler();
 
     /* Parse release out of object dn */
-    $release = preg_replace("/".get_ou("applicationRDN").normalizePreg($this->base)."$/","",$this->dn);
+    $release = preg_replace("/".get_ou("applicationRDN").preg_quote($this->base)."$/","",$this->dn);
     $release = preg_replace("/^cn=[^,]+,/","",$release);
 
     /* Get a list of all groups 
@@ -249,7 +249,7 @@ class application extends plugin
       $ldap->cd($release.$group);
       $ldap->search("(objectClass=gotoMenuEntry)",array("dn"));
       while($attrs = $ldap->fetch()){
-        $info = preg_replace("/".normalizePreg($release.$group)."$/","",$attrs['dn']); 
+        $info = preg_replace("/".preg_quote($release.$group)."$/","",$attrs['dn']); 
         if(preg_match("/^cn=".$this->cn."/",$info) && !preg_match("/ou=[^,]+,/",$info)){
           $found[] = $attrs['dn'];
         }
index 0a8914e51ba4793ca1986c4d8ec37eb38025a614..942e1c4bf5cfff6955df6f79e04d0f6e7368635a 100644 (file)
@@ -572,7 +572,7 @@ class applicationManagement extends plugin
     if(!$this->IsReleaseManagementActivated()){
       $use_base = $this->app_base;
       if($SubSearch){
-        $use_base = preg_replace("/^".normalizePreg(get_ou("applicationRDN"))."/","",$use_base);
+        $use_base = preg_replace("/^".preg_quote(get_ou("applicationRDN"))."/","",$use_base);
       }
     }else{
       $use_base = $this->app_release;
index f69fe17890cbee57918e489dd177c2c62a84d5fb..069c394238443205baeffd047dab132284176c7c 100644 (file)
@@ -92,7 +92,7 @@ class appgroup extends plugin
           and fetch all applications from those departments.
        */
       foreach($app_deps as $dep){
-        if(preg_match("/^".normalizePreg($release_info['suffix'])."/",$dep)){
+        if(preg_match("/^".preg_quote($release_info['suffix'])."/",$dep)){
           $ret = array_merge($ret,get_list("(objectClass=gosaApplication)","application",$dep,array("*"),GL_NONE));
         }
       }
@@ -187,7 +187,7 @@ class appgroup extends plugin
           $all = $this->_get_all_entries();
           $found = FALSE;
           foreach($all as $entry){
-            if(isset($entry['DN']) && preg_match("/^".normalizePreg($bb)."/",$entry['DN'])){
+            if(isset($entry['DN']) && preg_match("/^".preg_quote($bb)."/",$entry['DN'])){
               $found =TRUE;
               break;
             }
@@ -259,7 +259,7 @@ class appgroup extends plugin
        */
       $cur          = &$this->a_Structure[0]['ENTRIES'];
       $parent_id    = $base['UNIQID'];
-      $sub_dn       = preg_replace("/,".normalizePreg($this->dn)."$/","",$attrs['dn']);
+      $sub_dn       = preg_replace("/,".preg_quote($this->dn)."$/","",$attrs['dn']);
       $sub_dn_array = split("\,",$sub_dn);
 
       /* Walk through our menu structure array while we have found 
@@ -431,7 +431,7 @@ class appgroup extends plugin
       $res = get_list("(objectClass=gosaDepartment)", "application", $this->curbase,array("description","cn","ou"),GL_SIZELIMIT);
       foreach($res as $value){
         $fdn = $value['dn'];
-        $fdn = preg_replace("/".normalizePreg($this->curbase)."/","",$fdn);
+        $fdn = preg_replace("/".preg_quote($this->curbase)."/","",$fdn);
         $fdn= @LDAP::fix($fdn);
         if($value["description"][0]!=".."){
           $departments[$value['dn']]= convert_department_dn($fdn)." - [".$value["description"][0]."]";
@@ -468,7 +468,7 @@ class appgroup extends plugin
       if(in_array($app['cn'][0],$used_apps)){
         continue;
       }
-      if(!preg_match("/".get_ou('applicationRDN').normalizePreg($this->curbase)."$/",$app['dn'])){
+      if(!preg_match("/".get_ou('applicationRDN').preg_quote($this->curbase)."$/",$app['dn'])){
         continue;
       }
 
index b097b88b87aed860073144574e3b7f8a6c797359..97b28e77949865b12206b45b6ab3c17fc0586749 100644 (file)
@@ -129,7 +129,7 @@ class mimetype extends plugin
         $this->base= dn2base($ui->dn);
       }
     } else {
-      $this->base= preg_replace ("/^.*,".normalizePreg(get_ou("mimetypeRDN"))."/", "", $this->dn);
+      $this->base= preg_replace ("/^.*,".preg_quote(get_ou("mimetypeRDN"))."/", "", $this->dn);
     }
 
     /* Get icon data */
index 219e17d06445d8fbb74fa370dd62f46d59d52aa3..ac4b762922a55cf42c7b0008cf84be0f80569e72 100644 (file)
@@ -585,7 +585,7 @@ class mimetypeManagement extends plugin
     if(!$this->IsReleaseManagementActivated()){
       $use_base = $this->mime_base;
       if($SubSearch){
-        $use_base = preg_replace("/^".normalizePreg(get_ou("mimeou"))."/","",$use_base);
+        $use_base = preg_replace("/^".preg_quote(get_ou("mimeou"))."/","",$use_base);
       }
     }else{
       $use_base = $this->mime_release;
@@ -682,7 +682,7 @@ class mimetypeManagement extends plugin
     if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
 
       /* Get dialog */
-      $this->CopyPasteHandler->SetVar("base",preg_replace("/^".normalizePreg(get_ou("mimetypeRDN"))."/","",$this->mime_base));
+      $this->CopyPasteHandler->SetVar("base",preg_replace("/^".preg_quote(get_ou("mimetypeRDN"))."/","",$this->mime_base));
       $this->CopyPasteHandler->SetVar("parent",$this);
       $data = $this->CopyPasteHandler->execute();
 
index 4041548a16441a7066f1e330db44d2b8d17f9c72..d6e2626e8da797dbb677077d4695faf9e2dd31ef 100644 (file)
@@ -63,11 +63,11 @@ class printgeneric extends plugin
 
     /* Update dn, to ensure storing as printer instead of WS / terminal */
     if(preg_match("/Terminal/i",$this->BelongsTo) || preg_match("/TerminalTemplate/i",$this->BelongsTo)){
-      $this->dn= preg_replace("/".normalizePreg(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
+      $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
     }
 
     if(preg_match("/Workstation/i",$this->BelongsTo) || preg_match("/WorkstationTemplate/i",$this->BelongsTo)){
-      $this->dn= preg_replace("/".normalizePreg(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
+      $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
     }
 
     $this->orig_dn = $this->dn;
@@ -96,10 +96,10 @@ class printgeneric extends plugin
     } else {
     
       /* Set base and check if the extracted base exists */
-      if(preg_match("/".normalizePreg(get_ou('systemIncomingRDN'))."/",$this->dn)){
-        $this->base= preg_replace("/".normalizePreg(get_ou('systemIncomingRDN'))."/","",dn2base($this->dn));
+      if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'))."/",$this->dn)){
+        $this->base= preg_replace("/".preg_quote(get_ou('systemIncomingRDN'))."/","",dn2base($this->dn));
       }else{
-        $this->base= preg_replace("/".normalizePreg(get_ou('printerRDN'))."/","",dn2base($this->dn));
+        $this->base= preg_replace("/".preg_quote(get_ou('printerRDN'))."/","",dn2base($this->dn));
       }
 
       if(!isset($this->config->idepartments[$this->base])){
@@ -220,11 +220,11 @@ class printgeneric extends plugin
       /* Update dn, to ensure storing as printer instead of WS / terminal
        */
       if(preg_match("/terminal/i",$this->BelongsTo)){
-        $this->dn= preg_replace("/".normalizePreg(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
+        $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
       }
 
       if(preg_match("/workstation/i",$this->BelongsTo)){
-        $this->dn= preg_replace("/".normalizePreg(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
+        $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
       }
 
       /* Detect if this is a valid printer account;
@@ -569,11 +569,11 @@ class printgeneric extends plugin
       /* Update dn, to ensure storing as printer instead of WS / terminal
        */
       if(preg_match("/terminal/i",$this->BelongsTo)){
-        $this->dn= preg_replace("/".normalizePreg(get_ou('terminalRDN')).",/",get_ou('printerRDN'),$this->dn);
+        $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN')).",/",get_ou('printerRDN'),$this->dn);
       }
 
       if(preg_match("/workstation/i",$this->BelongsTo)){
-        $this->dn= preg_replace("/".normalizePreg(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
+        $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
       }
 
       /* Check if this dn points to a printer, to avoid deleting something else */
@@ -716,11 +716,11 @@ class printgeneric extends plugin
     /* Update dn, to ensure storing as printer instead of WS / terminal
      */
     if(preg_match("/terminal/i",$this->BelongsTo)){
-      $this->dn= preg_replace("/".normalizePreg(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
+      $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
     }
 
     if(preg_match("/workstation/i",$this->BelongsTo)){
-      $this->dn= preg_replace("/".normalizePreg(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
+      $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
     }
     
     if(!$this->is_account) return;
@@ -847,7 +847,7 @@ class printgeneric extends plugin
     }
 
     /* Ensure to create a new object */
-    if(preg_match("/".normalizePreg(get_ou('systemIncomingRDN'))."/",$this->orig_dn)){
+    if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'))."/",$this->orig_dn)){
       $this->orig_dn = "new";
     }
 
index 350195bb9806b86e732807271f440c1e153903e1..d18612059dd397b881f15b333ba479f700e54624 100644 (file)
@@ -126,7 +126,7 @@ class termgeneric extends plugin
       $ui= get_userinfo();
       $this->base= dn2base($ui->dn);
     } else {
-      $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("terminalRDN"))."/", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("terminalRDN"))."/", "", $this->dn);
     }
 
     /* Create an array of all Syslog servers */
@@ -463,7 +463,7 @@ class termgeneric extends plugin
       }
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
-          if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".normalizePreg(get_ou('systemIncomingRDN'))."/", $ldap->getDN())){
+          if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou('systemIncomingRDN'))."/", $ldap->getDN())){
             continue;
           } else {
             if ($attrs['dn'] != $this->orig_dn){
index 9236b8bec04a472fd7856ba5dc1dac599b68991f..f156bc07507582fe557c873c3b3ed06a30080084 100644 (file)
@@ -639,7 +639,7 @@ class termservice extends plugin
            */
           $p = $this->parent->by_object['ogroup'];
           foreach($p->memberList as $dn => $obj){
-            if(preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$dn)) continue;
+            if(preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$dn)) continue;
             if(isset($p->objcache[$dn]['macAddress']) && !empty($p->objcache[$dn]['macAddress'])){
               $macs[] = $p->objcache[$dn]['macAddress'];
             }
@@ -649,7 +649,7 @@ class termservice extends plugin
           /* We are a workstation. Add current mac.
            */
           $mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
-          if(!empty($mac) && !preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
+          if(!empty($mac) && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
             $macs[] = $mac;
           }
         }
index 083f981c50c0a1555314fdd3338d73c2cbbd0425..4ec0149260391411df36c9f32f8d1f7a702c2958 100644 (file)
@@ -143,7 +143,7 @@ class workgeneric extends plugin
       $ui= get_userinfo();
       $this->base= dn2base($ui->dn);
     } else {
-      $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("workstationRDN"))."/i", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("workstationRDN"))."/i", "", $this->dn);
     }
 
     /* Create an array of all Syslog servers */
@@ -502,7 +502,7 @@ class workgeneric extends plugin
     }else{
       /* Warn the user, that this host is currently installing */
       if($this->currently_installing && !$this->currently_installing_warned && 
-          !preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
+          !preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
       
         /* Force aborting without message dialog */
         $message[] = "";
index 1aae67b27c6a00f7cc8951f782b65ac444fdfb4f..f3a7f17a15c52d155e5c3503335b8042cf880631 100644 (file)
@@ -527,7 +527,7 @@ class workservice extends plugin
            */
           $p = $this->parent->by_object['ogroup'];
           foreach($p->memberList as $dn => $obj){
-            if(preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$dn)) continue;
+            if(preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$dn)) continue;
             if(isset($p->objcache[$dn]['macAddress']) && !empty($p->objcache[$dn]['macAddress'])){
               $macs[] = $p->objcache[$dn]['macAddress'];
             }
@@ -537,7 +537,7 @@ class workservice extends plugin
           /* We are a workstation. Add current mac.
            */
           $mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
-          if(!empty($mac) && !preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
+          if(!empty($mac) && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
             $macs[] = $mac;
           }          
         }
index 7f910757eb38ec95f608e970cadcb4938d783e69..3b623259d1316bf5cac5209fa0edf2758f3605cf 100644 (file)
@@ -1338,7 +1338,7 @@ class workstartup extends plugin
    */
   function dn_to_release_name($dn)
   {
-    $relevant = preg_replace("/,".normalizePreg(get_ou("faiBaseRDN")).".*$/","",$dn);
+    $relevant = preg_replace("/,".preg_quote(get_ou("faiBaseRDN")).".*$/","",$dn);
     $parts    = array_reverse(split("\,",$relevant));
     $str ="";
     foreach($parts as $part){
index 3a86186ce3207ef32ded0cddfbb27b984bb7aae1..f2dc8669c91085d73b75e1aa1581398643aa4016 100644 (file)
@@ -106,7 +106,7 @@ class goLdapServer extends goService{
       while($attrs = $ldap->fetch()){
         $ldapServer = array();
         for($i = 0 ; $i < $attrs['gotoLdapServer']['count'] ; $i ++ ){
-          $ldapServer[] = preg_replace("/".normalizePreg($this->oldBase)."/",$this->goLdapBase,$attrs['gotoLdapServer'][$i]);
+          $ldapServer[] = preg_replace("/".preg_quote($this->oldBase)."/",$this->goLdapBase,$attrs['gotoLdapServer'][$i]);
         }
         $new[$attrs['dn']]['gotoLdapServer'] = $ldapServer;
       }
index 958c2ae7d235307c52b77407d0621729cea68d3a..42b8781c2300526bd202231c132b03dbd7a80b83 100644 (file)
@@ -307,9 +307,9 @@ class gosa_logview extends plugin
         if(isset($this->uid_map[$line['user']])){
           $user = $this->uid_map[$line['user']];
         }else{
-          $user = preg_replace("/,".normalizePreg($this->config->current['BASE'])."/",$base,$line['user']);
+          $user = preg_replace("/,".preg_quote($this->config->current['BASE'])."/",$base,$line['user']);
         }
-        $object = preg_replace("/,".normalizePreg($this->config->current['BASE'])."/",$base,$line['object']);
+        $object = preg_replace("/,".preg_quote($this->config->current['BASE'])."/",$base,$line['object']);
 
         $res.=" <tr style=\"$col\">\n";
         $res.="   <td title='".$line['objecttype']."'>".$line['action']."</td>";
index 3a83d5040fdc449c0dd20688bc73460ecf139c6d..d9159bafb9a171e0afad7630c698fc904602d851 100644 (file)
@@ -241,7 +241,7 @@ class mailqueue extends plugin
     foreach($hosts as $mac){
       $found = FALSE;
       foreach($res as $entry){
-        if(preg_match("/^".normalizePreg($mac)."$/i",$entry['macAddress'][0])){
+        if(preg_match("/^".preg_quote($mac)."$/i",$entry['macAddress'][0])){
           $ret[$mac] = $entry['cn'][0];
           $found = TRUE;
           break;
index 9992d9f2fcc7a9744def6f0420c3d6fde6cbf874..553150cd8e652ee2839c33a7c529dffdc2edd817 100644 (file)
@@ -38,7 +38,7 @@ class si_mailqueue extends gosaSupportDaemon
 
     /* Prepare search filter 
      */
-    $search_str = preg_replace("/\\\\\*/",".*",normalizePreg($search_str));
+    $search_str = preg_replace("/\\\\\*/",".*",preg_quote($search_str));
 
     /* Query mailqueue 
      */
index 147661bf8235683855725f8ba83a36e077583b50..5553dfd666082b3d1cbb9992d865d71b22b9de8b 100644 (file)
@@ -155,7 +155,7 @@ class mailMethodCyrus extends mailMethod
 
         /* Cut domain name */
         $val = preg_replace("/@.*$/","",$val);
-        $result[]=preg_replace ("/^.*".normalizePreg($folder)."/","INBOX", mb_convert_encoding($val, "UTF-8", "UTF7-IMAP"));
+        $result[]=preg_replace ("/^.*".preg_quote($folder)."/","INBOX", mb_convert_encoding($val, "UTF-8", "UTF7-IMAP"));
       }
     }
 
index 05c18449a5472ca794ccd731958e9259da3c1898..970f2c7f3295cd58617cf81538e854fd7d34c2f6 100644 (file)
@@ -183,7 +183,7 @@ class krbHostKeys extends plugin
            */
           foreach($this->server_list as $server => $data){
             foreach($data['PRINCIPALS'] as $p_name){
-              if(preg_match("/\/".normalizePreg($this->namingAttr)."\@/",$p_name)){
+              if(preg_match("/\/".preg_quote($this->namingAttr)."\@/",$p_name)){
                 $pre = preg_replace("/\/.*$/","/",$p_name);
                 $this->delete_key($server, $pre.$this->namingAttr."@".$data['REALM']);
                 $this->create_key($server, $pre.$this->object->cn."@".$data['REALM']);
@@ -204,7 +204,7 @@ class krbHostKeys extends plugin
 
             /* Collect all principals for the current host. 
              */
-            if(preg_match("/\/".normalizePreg($this->namingAttr)."\@/",$p_name)){
+            if(preg_match("/\/".preg_quote($this->namingAttr)."\@/",$p_name)){
               $pre = preg_replace("/\/.*$/","/",$p_name);
               $found[] = "<b>".$pre.$this->namingAttr."@".$data['REALM']."</b> ".
                 _("updated to").
@@ -265,7 +265,7 @@ class krbHostKeys extends plugin
       $master_princ = $prefix.$this->namingAttr."@".$realm;
 
       foreach($server['PRINCIPALS'] as $id => $princ){
-        if(preg_match("/^".normalizePreg($master_princ)."$/i",$princ)){
+        if(preg_match("/^".preg_quote($master_princ)."$/i",$princ)){
           $found = TRUE;
           break;
         }
@@ -297,8 +297,8 @@ class krbHostKeys extends plugin
        */
       if(!$service_plugin){
         foreach($server['PRINCIPALS'] as $id => $princ){
-          if(preg_match("/".normalizePreg("/".$this->namingAttr."@")."/i",$princ) &&
-              !preg_match("/^".normalizePreg($prefix)."/",$princ)){
+          if(preg_match("/".preg_quote("/".$this->namingAttr."@")."/i",$princ) &&
+              !preg_match("/^".preg_quote($prefix)."/",$princ)){
 
             /* Display buttons to "create" or to "remove/recreate" wheteher the prefix esists or not 
              */
@@ -428,7 +428,7 @@ class krbHostKeys extends plugin
 
         /* Detect all principals for the current host.
          */
-        if(preg_match("/".normalizePreg($prefix.$this->namingAttr)."\@/",$p_name)){
+        if(preg_match("/".preg_quote($prefix.$this->namingAttr)."\@/",$p_name)){
           $this->delete_key($server, $p_name);
         }
       }
index 89c2527a1caf47a4d5998a7cdda5394b067f6226..7791cb4e0a42f4e9e85f3f3cef111600928419dc 100644 (file)
@@ -118,7 +118,7 @@ class netatalk extends plugin {
     if($this->dn === "new" || $this->dn === NULL) {
       $base  = session::get('CurrentMainBase');
     } else {
-      $base = preg_replace("/^[^,]+,".normalizePreg(get_people_ou())."/","",$this->dn);
+      $base = preg_replace("/^[^,]+,".preg_quote(get_people_ou())."/","",$this->dn);
     }
 
     $ldap->cd($base);
index 4737d6afc2d82e2e12142f6948e9d997b5bae0ce..1cc1186f9f58076c72953f3ab4aad58e94964bdf 100644 (file)
@@ -108,7 +108,7 @@ class opsiGeneric extends plugin
          #FIXME Implement an opsi method which returns infos for only one opsi client, not all. 
        */
       foreach($list as $entry){
-        if(preg_match("/^".normalizePreg($this->hostId)."$/i",$entry['NAME'][0]['VALUE'])){
+        if(preg_match("/^".preg_quote($this->hostId)."$/i",$entry['NAME'][0]['VALUE'])){
           $this->initially_was_account = TRUE; 
           $this->is_account = TRUE;
           foreach(array(
index 63e20f21b88e08c301ac994e20d07ccb1872b170..1cac6ba02cda3267c982e5e7bfeb60e37b393a19 100644 (file)
@@ -59,7 +59,7 @@ class wingeneric extends plugin
       $this->base= dn2base($ui->dn);
       $this->cn= "";
     } else {
-      $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_winstations_ou())."/", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_winstations_ou())."/", "", $this->dn);
     }
 
     $this->cn= preg_replace("/\\\$\$/","",$this->cn);
index 743da7e2c9908e35e5b7772a4f60d056b1065955..72a770afbea776a5d971c0f7e76ed6748c72ba3c 100644 (file)
@@ -50,7 +50,7 @@ class componentGeneric extends plugin
       $this->base= dn2base($ui->dn);
       $this->cn= "";
     } else {
-      $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("componentRDN"))."/", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("componentRDN"))."/", "", $this->dn);
     }
     $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true);
     /* Save dn for later references */
@@ -232,7 +232,7 @@ class componentGeneric extends plugin
           if(preg_match("/cn=dhcp,/",$attrs['dn'])){
             continue;
           }
-          if ($attrs['dn'] != $this->orig_dn && preg_match("/".normalizePreg(get_ou("componentRDN"))."/",$attrs['dn'])){
+          if ($attrs['dn'] != $this->orig_dn && preg_match("/".preg_quote(get_ou("componentRDN"))."/",$attrs['dn'])){
             $message[]= msgPool::duplicated(_("Component name"));
             break;
           }
index 664f024c7c5d6192b24db4d2a5567642b6f1929e..44b1cc4a8579e14ac8eca178d43d23df3549442b 100644 (file)
@@ -92,7 +92,7 @@ class servgeneric extends plugin
       $this->base= dn2base($ui->dn);
       $this->cn= "";
     } else {
-      $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("serverRDN"))."/", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("serverRDN"))."/", "", $this->dn);
     }
     $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
     $this->netConfigDNS->set_acl_category("server");
@@ -361,7 +361,7 @@ class servgeneric extends plugin
     }
 
     /* Warn the user, that this host is currently installing */
-    if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
+    if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
 
       /* Force aborting without message dialog */
       $message[] = "";
index f2c37eecf1fb58dad694940c67fa852bea23cce4..07cea7c68d115b9770931d5fb45c2312c7314a5c 100644 (file)
@@ -1041,7 +1041,7 @@ class systems extends plugin
 
       $dialog     = FALSE;
       $hide_apply = $this->dn == "new";
-      $hide_apply = ($this->dn == "new") || (preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->dn));
+      $hide_apply = ($this->dn == "new") || (preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$this->dn));
       if(is_object($this->systab) && !isset($this->systab->by_object)){
         $dialog = TRUE;
         $hide_apply = TRUE;
index 58d9a23a2d59eb13417237478e2f3fb96a574d1f..059e4f9614878df1c3be98e1c1fb0a5490b17105 100644 (file)
@@ -1035,7 +1035,7 @@ class termDNS extends plugin
 
   function get_dhcp_parent_node()
   {
-    return(preg_replace("/^cn=".normalizePreg($this->cn).",/","",$this->get_dhcp_host_entry_dn()));
+    return(preg_replace("/^cn=".preg_quote($this->cn).",/","",$this->get_dhcp_host_entry_dn()));
   }
 
 
@@ -1084,7 +1084,7 @@ class termDNS extends plugin
       $tmp = array_flip($this->Zones);
       $tmp = preg_replace("/^[^\/]*+\//","",$tmp[$this->dnsEntry['zoneName']]);
       $tmp = trim(preg_replace("/\.in-addr.arpa$/","",$tmp));
-      $ptr = preg_replace("/^".normalizePreg(DNS::FlipIp($tmp))."\./","",$this->ipHostNumber);
+      $ptr = preg_replace("/^".preg_quote(DNS::FlipIp($tmp))."\./","",$this->ipHostNumber);
       return($ptr);
     }else{
       return(FALSE);
@@ -1111,7 +1111,7 @@ class termDNS extends plugin
     $ret = array();
     foreach($arr as $r => $name){
       $base_part = str_replace($base,"",$r);
-      if(preg_match("/^[a-z]*=".normalizePreg($name)."(|,)$/i",$base_part)){
+      if(preg_match("/^[a-z]*=".preg_quote($name)."(|,)$/i",$base_part)){
         $ret[$r] = $current.$name;
         $tmp = $this->create_tree($arr,$r,$current.".&nbsp;");
         foreach($tmp as $sub_key => $sub_name){