From aea4ca9220c65218609770ec2e1b7ee53e5ae69f Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 20 May 2010 10:16:15 +0000 Subject: [PATCH] Updated RDN checks - the trailing ',' is optional git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18595 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_configRegistry.inc | 2 +- .../addons/propertyEditor/migration/class_migrateRDN.inc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc index 420c00346..f892a861f 100644 --- a/gosa-core/include/class_configRegistry.inc +++ b/gosa-core/include/class_configRegistry.inc @@ -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){ diff --git a/gosa-core/plugins/addons/propertyEditor/migration/class_migrateRDN.inc b/gosa-core/plugins/addons/propertyEditor/migration/class_migrateRDN.inc index 4d619ba08..f4e17f4f9 100644 --- a/gosa-core/plugins/addons/propertyEditor/migration/class_migrateRDN.inc +++ b/gosa-core/plugins/addons/propertyEditor/migration/class_migrateRDN.inc @@ -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){ -- 2.30.2