use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
+use Friendica\Protocol\Diaspora;
require_once 'include/bbcode.php';
require_once 'mod/proxy.php';
$location = $pdesc = $gender = $marital = $homepage = $about = false;
}
- $firstname = ((strpos($profile['name'], ' '))
- ? trim(substr($profile['name'], 0, strpos($profile['name'], ' '))) : $profile['name']);
- $lastname = (($firstname === $profile['name']) ? '' : trim(substr($profile['name'], strlen($firstname))));
+ $splitted_name = Diaspora::splitName($profile['name']);
+ $firstname = $splitted_name['first'];
+ $lastname = $splitted_name['last'];
if ($profile['guid'] != "") {
$diaspora = array(
*
* @return array The array with "first" and "last"
*/
- private static function splitName($name) {
+ public static function splitName($name) {
$name = trim($name);
// Is the name longer than 64 characters? Then cut the rest of it.