Code

Replaced str_ireplace it is not PHP4 compatible.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Sep 2006 07:34:06 +0000 (07:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Sep 2006 07:34:06 +0000 (07:34 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4625 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions_FAI.inc

index 6843c0d48610a32c24fdfcf0b5dbf5515a6f75c5..2c9297cad61318ec18086630e0982d10710fb70a 100644 (file)
@@ -44,7 +44,8 @@ function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false)
       while($attr = $ldap->fetch()){
         
         $buffer = array();
-        $name = str_ireplace($release,"",$attr['dn']);
+#        $name = str_ireplace($release,"",$attr['dn']);
+        $name = preg_replace("/".normalizePreg($release)."/i","",$attr['dn']);
 
         if(isset($attr['FAIstate'][0])){
           if(preg_match("/removed$/",$attr['FAIstate'][0])){
@@ -402,7 +403,8 @@ function clean_up_releases($Current_DN)
       while($attr = $ldap->fetch()){
         
         $buffer = array();
-        $name = str_ireplace($release,"",$attr['dn']);
+#        $name = str_ireplace($release,"",$attr['dn']);
+        $name = preg_replace("/".normalizePreg($release)."/i","",$attr['dn']);
 
         if(isset($attr['FAIstate'][0])&&(preg_match("/removed$/",$attr['FAIstate'][0]))){
 
@@ -507,7 +509,8 @@ function get_following_releases_that_inherit_this_object($dn)
   $sub_releases = get_sub_releases_of_this_release($base_release);
 
   /* Get dn suffix. Example  "FAIvairableEntry=keksdose,FAIvariable=Keksregal," */
-  $dn_suffix = str_ireplace($base_release,"",$dn);
+#  $dn_suffix = str_ireplace($base_release,"",$dn);
+  $dn_suffix = preg_replace("/".normalizePreg($base_release)."/i","",$dn);
 
   /* Check if given object also exists whitin one of these releases */
   foreach($sub_releases as $p_release => $name){
@@ -547,7 +550,8 @@ function get_parent_release_object($dn,$include_myself=true)
   }
 
   /* Get dn suffix. Example  "FAIvairableEntry=keksdose,FAIvariable=Keksregal," */
-  $dn_suffix = str_ireplace($base_release,"",$dn);
+#  $dn_suffix = str_ireplace($base_release,"",$dn);
+  $dn_suffix = preg_replace("/".normalizePreg($base_release)."/i","",$dn);
     
   /* Check if given object also exists whitin one of these releases */
   foreach($previous_releases as $p_release){
@@ -571,7 +575,10 @@ function get_previous_releases_of_this_release($dn,$flat)
   $ret = array();
 
   /* Explode dns into pieces, to be able to build parent dns */
-  $dns_to_check = ldap_explode_dn(str_ireplace(",".$config->current['BASE'],"",$dn),0);
+#  $dns_to_check = ldap_explode_dn(str_ireplace(",".$config->current['BASE'],"",$dn),0);
+  $dns_to_check = ldap_explode_dn(preg_replace("/".normalizePreg(",".$config->current['BASE'])."/i","",$dn),0);
+  echo "<font color='red'>Replace ldap_explode_dn it is evil, it changes characters within result... </font><br>";
+
   if(!is_array($dns_to_check)){
     return;  
   }
@@ -675,7 +682,10 @@ function get_release_dn($Current_DN)
   $ldap->cd($config->current['BASE']);
 
   /* Split dn into pices */ 
-  $dns_to_check = ldap_explode_dn(str_ireplace(",".$config->current['BASE'],"",$Current_DN),0);
+#  $dns_to_check = ldap_explode_dn(str_ireplace(",".$config->current['BASE'],"",$Current_DN),0);
+  $dns_to_check = ldap_explode_dn(preg_replace("/".normalizePreg(",".$config->current['BASE'])."/i","",$Current_DN),0);
+  echo "<font color='red'>Replace ldap_explode_dn it is evil, it changes characters within result... </font><br>";
+
   if(!is_array($dns_to_check)){
     return;  
   }