From 4f9cffb729176413f627caa29815f02646d157df Mon Sep 17 00:00:00 2001 From: cajus Date: Sat, 21 May 2005 09:50:42 +0000 Subject: [PATCH] Fixed problem with case sensitivity in class name comparals. PHP5 returns case sensitive parameters, while PHP4 returns lowercase ones. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@315 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_password-methods.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/class_password-methods.inc b/include/class_password-methods.inc index 97157804e..f580eb758 100644 --- a/include/class_password-methods.inc +++ b/include/class_password-methods.inc @@ -66,18 +66,18 @@ class passwordMethod function get_available_methods() { $ret =false; - $all = (get_declared_classes()); + $all = get_declared_classes(); $i = 0; foreach($all as $one) { - if((strstr($one,"passwordmethod" ))&&($one != "passwordmethod")){ - $name = str_replace ("passwordmethod","",$one); + if(preg_match('/passwordMethod/i', $one) && !preg_match("/^passwordMethod$/i", $one)){ + $name = preg_replace ("/passwordMethod/i", "", $one); $test = new $one(false); if($test->is_available()) { - $ret['name'][$i]=str_replace ("passwordmethod","",$one); + $ret['name'][$i]= preg_replace ("/passwordMethod/i","",$one); $ret['class'][$i]=$one; - $ret[$i]['name']=str_replace ("passwordmethod","",$one); - $ret[$i]['class']=$one; - $ret[str_replace ("passwordmethod","",$one)]=$one; + $ret[$i]['name']= preg_replace("/passwordMethod/i","",$one); + $ret[$i]['class']= $one; + $ret[preg_replace ("/passwordMethod/i","",$one)]=$one; $i++; } } -- 2.30.2