Code

Updated RDN checks - the trailing ',' is optional
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 20 May 2010 10:16:15 +0000 (10:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 20 May 2010 10:16:15 +0000 (10:16 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18595 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_configRegistry.inc
gosa-core/plugins/addons/propertyEditor/migration/class_migrateRDN.inc

index 420c0034650a8e1d69b1261d0ea54e1555c6c3a0..f892a861f5b16d20fb9041588168f00193bc4ff9 100644 (file)
@@ -417,7 +417,7 @@ class gosaProperty
 
     static function isRdn($message,$class,$name,$value, $type)
     {
-        $match = preg_match("/^([a-z]*=[^=,]*,)*[^=]*=[^=]*,$/i", $value);
+        $match = preg_match("/^([a-z]*=[^=,]*,)*[^=]*=[^=]*,?$/i", $value);
 
         // Display the reason for failing this check.         
         if($message && ! $match){
index 4d619ba0803675eb3f50c63d63e5e0402f8da749..f4e17f4f9a806cda18add27f6f347aef5f1ad8a2 100644 (file)
@@ -60,6 +60,9 @@ class migrateRDN implements propertyMigration
         $initialValue = $this->prefix.$this->property->getValue().$this->suffix;
         $targetValue = $this->prefix.$this->property->getValue(TRUE).$this->suffix;
 
+        if(!empty($initialValue) && !preg_match("/,$/", $initialValue)) $initialValue.=",";
+        if(!empty($targetValue) && !preg_match("/,$/", $targetValue)) $targetValue.=",";
+
         $dnMatch = "";
         if(!empty($initialValue)){
             foreach(preg_split("/,/", $initialValue) as $rdnPart){