From 8e7a67036810003fc2bdf835f9bdb98b4eea3bbe Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 31 Oct 2008 15:53:01 +0000 Subject: [PATCH] Removed a couple of normalize_preg calls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12851 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../departments/class_departmentGeneric.inc | 4 +-- .../admin/users/class_userManagement.inc | 4 +-- gosa-core/setup/class_setupStep_Migrate.inc | 10 +++---- .../addons/addressbook/class_addressbook.inc | 4 +-- .../systems/services/dhcp/class_servDHCP.inc | 8 ++--- .../admin/systems/services/dns/class_DNS.inc | 10 +++---- .../systems/services/dns/class_servDNS.inc | 6 ++-- .../services/dns/class_servDNSeditZone.inc | 2 +- .../dns/class_servDNSeditZoneEntries.inc | 2 +- gosa-plugins/fai/admin/fai/class_FAI.inc | 30 +++++++++---------- gosa-plugins/fai/admin/fai/class_faiHook.inc | 8 ++--- .../fai/admin/fai/class_faiManagement.inc | 16 +++++----- .../fai/admin/fai/class_faiPackage.inc | 8 ++--- .../fai/admin/fai/class_faiPartitionTable.inc | 14 ++++----- .../fai/admin/fai/class_faiProfile.inc | 2 +- .../fai/admin/fai/class_faiScript.inc | 8 ++--- .../fai/admin/fai/class_faiSummaryTab.inc | 2 +- .../fai/admin/fai/class_faiTemplate.inc | 8 ++--- .../fai/admin/fai/class_faiVariable.inc | 4 +-- .../systems/gofon/class_phoneGeneric.inc | 2 +- .../class_phoneConferenceGeneric.inc | 2 +- .../gofon/gofon/macro/class_gofonMacro.inc | 2 +- .../gofon/phoneaccount/class_phoneAccount.inc | 2 +- .../applications/class_applicationGeneric.inc | 4 +-- .../class_applicationManagement.inc | 2 +- .../groups/apps/class_groupApplication.inc | 10 +++---- .../admin/mimetypes/class_mimetypeGeneric.inc | 2 +- .../mimetypes/class_mimetypeManagement.inc | 4 +-- .../admin/systems/goto/class_printGeneric.inc | 24 +++++++-------- .../systems/goto/class_terminalGeneric.inc | 4 +-- .../systems/goto/class_terminalService.inc | 4 +-- .../systems/goto/class_workstationGeneric.inc | 4 +-- .../systems/goto/class_workstationService.inc | 4 +-- .../systems/goto/class_workstationStartup.inc | 2 +- .../services/ldap/class_goLdapServer.inc | 2 +- .../log/addons/logview/class_gosa_logview.inc | 4 +-- .../mail/addons/mailqueue/class_mailqueue.inc | 2 +- .../addons/mailqueue/class_si_mailqueue.inc | 2 +- .../mail/class_mail-methods-cyrus.inc | 2 +- .../services/kerberos/class_krb_host_keys.inc | 12 ++++---- .../personal/netatalk/class_netatalk.inc | 2 +- .../opsi/admin/opsi/class_opsigeneric.inc | 2 +- .../admin/systems/samba/class_winGeneric.inc | 2 +- .../admin/systems/class_componentGeneric.inc | 4 +-- .../admin/systems/class_servGeneric.inc | 4 +-- .../admin/systems/class_systemManagement.inc | 2 +- .../systems/admin/systems/class_termDNS.inc | 6 ++-- 47 files changed, 134 insertions(+), 134 deletions(-) diff --git a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc index d256d7a68..27ad5c002 100644 --- a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc +++ b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc @@ -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; diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 3cafa8266..35c12d151 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -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{ diff --git a/gosa-core/setup/class_setupStep_Migrate.inc b/gosa-core/setup/class_setupStep_Migrate.inc index 9de097644..70fb3b4f2 100644 --- a/gosa-core/setup/class_setupStep_Migrate.inc +++ b/gosa-core/setup/class_setupStep_Migrate.inc @@ -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; diff --git a/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc b/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc index 369acd0dd..fd3304b08 100644 --- a/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc +++ b/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc @@ -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); } diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc index 1a2222230..1b5201d24 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc @@ -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; } diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc index af7994697..205e33209 100644 --- a/gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc +++ b/gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc @@ -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 diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc index bd90bd28d..aa9722b10 100644 --- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc +++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc @@ -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; diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc index 160790fab..b5854fc9d 100644 --- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc +++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc @@ -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]); } } diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc index 78b9be741..59cab8701 100644 --- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc +++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc @@ -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){ diff --git a/gosa-plugins/fai/admin/fai/class_FAI.inc b/gosa-plugins/fai/admin/fai/class_FAI.inc index e6e191814..677a8b925 100644 --- a/gosa-plugins/fai/admin/fai/class_FAI.inc +++ b/gosa-plugins/fai/admin/fai/class_FAI.inc @@ -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 "
-->".$Current_DN."
"; echo "
-->".$obj_dn."
"; @@ -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; diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc index 5753521c6..5005cce15 100644 --- a/gosa-plugins/fai/admin/fai/class_faiHook.inc +++ b/gosa-plugins/fai/admin/fai/class_faiHook.inc @@ -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"; diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index adf9d12cb..3114ba7fa 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -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){ diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc index 22c8637c0..d62a5458c 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackage.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackage.inc @@ -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= ""; diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc index eac75522a..d83ae91b6 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc @@ -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"; diff --git a/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/gosa-plugins/fai/admin/fai/class_faiProfile.inc index e6c007efb..9eca6ad65 100644 --- a/gosa-plugins/fai/admin/fai/class_faiProfile.inc +++ b/gosa-plugins/fai/admin/fai/class_faiProfile.inc @@ -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"); diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index 7a480bbea..a762beb54 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -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"; diff --git a/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc b/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc index 99e604378..6d6aa0b42 100644 --- a/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc +++ b/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc @@ -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]; diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc index f53314bda..3bc50dd4a 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc @@ -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"; diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc index 40ece1325..f8f1b3be4 100644 --- a/gosa-plugins/fai/admin/fai/class_faiVariable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiVariable.inc @@ -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"); diff --git a/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc b/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc index f40e3cb71..e0b758aaf 100644 --- a/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc +++ b/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc @@ -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 != ""){ diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc index 1c2e698aa..899b2c231 100644 --- a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc +++ b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc @@ -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; diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc index 273e68531..d9f2cf6ba 100644 --- a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc +++ b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc @@ -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 diff --git a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc index 2d2344397..2176e776b 100644 --- a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc +++ b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc @@ -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; } diff --git a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc index 953f45a82..f8364a099 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc @@ -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']; } diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc index 0a8914e51..942e1c4bf 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc @@ -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; diff --git a/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc b/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc index f69fe1789..069c39423 100644 --- a/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc +++ b/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc @@ -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; } diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc index b097b88b8..97b28e779 100644 --- a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc +++ b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc @@ -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 */ diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc index 219e17d06..ac4b76292 100644 --- a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc +++ b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc @@ -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(); diff --git a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc index 4041548a1..d6e2626e8 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc @@ -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"; } diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc index 350195bb9..d18612059 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc @@ -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){ diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc index 9236b8bec..f156bc075 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc @@ -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; } } diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index 083f981c5..4ec014926 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -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[] = ""; diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc index 1aae67b27..f3a7f17a1 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc @@ -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; } } diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc index 7f910757e..3b623259d 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc @@ -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){ diff --git a/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc b/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc index 3a86186ce..f2dc8669c 100644 --- a/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc +++ b/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc @@ -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; } diff --git a/gosa-plugins/log/addons/logview/class_gosa_logview.inc b/gosa-plugins/log/addons/logview/class_gosa_logview.inc index 958c2ae7d..42b8781c2 100644 --- a/gosa-plugins/log/addons/logview/class_gosa_logview.inc +++ b/gosa-plugins/log/addons/logview/class_gosa_logview.inc @@ -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.=" \n"; $res.=" ".$line['action'].""; diff --git a/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc b/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc index 3a83d5040..d9159bafb 100644 --- a/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc +++ b/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc @@ -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; diff --git a/gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc b/gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc index 9992d9f2f..553150cd8 100644 --- a/gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc +++ b/gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc @@ -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 */ diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc index 147661bf8..5553dfd66 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc @@ -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")); } } diff --git a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc index 05c18449a..970f2c7f3 100644 --- a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc +++ b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc @@ -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[] = "".$pre.$this->namingAttr."@".$data['REALM']." ". _("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); } } diff --git a/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc b/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc index 89c2527a1..7791cb4e0 100644 --- a/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc +++ b/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc @@ -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); diff --git a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc index 4737d6afc..1cc1186f9 100644 --- a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc +++ b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc @@ -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( diff --git a/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc b/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc index 63e20f21b..1cac6ba02 100644 --- a/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc +++ b/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc @@ -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); diff --git a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc index 743da7e2c..72a770afb 100644 --- a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc @@ -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; } diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc index 664f024c7..44b1cc4a8 100644 --- a/gosa-plugins/systems/admin/systems/class_servGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_servGeneric.inc @@ -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[] = ""; diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index f2c37eecf..07cea7c68 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -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; diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc index 58d9a23a2..059e4f961 100644 --- a/gosa-plugins/systems/admin/systems/class_termDNS.inc +++ b/gosa-plugins/systems/admin/systems/class_termDNS.inc @@ -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.". "); foreach($tmp as $sub_key => $sub_name){ -- 2.30.2