From 3a88b8ec35306d29c4a66deca956d99ddd3c4452 Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 22 Aug 2005 06:08:05 +0000 Subject: [PATCH] Fixed gecos field which is not utf-8 conform git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1192 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/personal/posix/class_posixAccount.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index 11463b413..f49106f4a 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -748,7 +748,10 @@ class posixAccount extends plugin /* Fill gecos */ if (isset($this->parent) && $this->parent != NULL){ - $this->gecos= $this->parent->by_object['user']->cn; + $this->gecos= rewrite($this->parent->by_object['user']->cn); + if (!preg_match('/[a-z0-9 -]/i', $this->gecos)){ + $this->gecos= ""; + } } /* Call parents save to prepare $this->attrs */ -- 2.30.2