From: Pascal Corpet Date: Sun, 6 Jun 2010 13:43:12 +0000 (+0200) Subject: Use the particle as name if name is empty X-Git-Tag: xorg/1.0.0~169 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=faf5f8341f017a4cb92c28d3a20675d6f400cef9;p=platal.git Use the particle as name if name is empty --- diff --git a/modules/profile/general.inc.php b/modules/profile/general.inc.php index 5ba5a8f..6967a38 100644 --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@ -153,11 +153,18 @@ class ProfileSettingSearchNames implements ProfileSetting } if ($sn['pub']) { if (isset($sn['particle']) && ($sn['particle'] != '')) { + // particle is before first blank list($particle, $name) = explode(' ', $sn['name'], 2); $particle = trim($particle) . ' '; if (!$name) { + // particle is before first quote list($particle, $name) = explode('\'', $sn['name'], 2); $particle = trim($particle); + if (!$name) { + // actually there is no particle + $particle = ''; + $name = $sn['name']; + } } } else { $particle = '';