From 22bdd6b9731d88085f48e00e1094673db47d56af Mon Sep 17 00:00:00 2001
From: Chris K <206-chris.k@users.noreply.git.cybbh.space>
Date: Thu, 7 Nov 2019 14:38:12 +0000
Subject: [PATCH 1/2] Update index.php

---
 apps/public/register/files/index.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/public/register/files/index.php b/apps/public/register/files/index.php
index 5fb054d3d..b76bfe7a3 100644
--- a/apps/public/register/files/index.php
+++ b/apps/public/register/files/index.php
@@ -24,7 +24,7 @@ $name = explode(".", $uid);
 $first = ucfirst($name[0]);
 
 // set first name to last value of array, and capitalize it
-$last = ucfirst(end($name));
+$last = ucfirst(end($name[2]));
 
 // remove numbers from last name (if present)
 $last = preg_replace('/[0-9]+/', '', $last);
-- 
GitLab


From 2d50cbcd6e9008e020aed0ac95e3cca95768ea67 Mon Sep 17 00:00:00 2001
From: Chris K <206-chris.k@users.noreply.git.cybbh.space>
Date: Thu, 7 Nov 2019 14:39:42 +0000
Subject: [PATCH 2/2] Update index.php

---
 apps/public/register/files/index.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/public/register/files/index.php b/apps/public/register/files/index.php
index b76bfe7a3..7d044039d 100644
--- a/apps/public/register/files/index.php
+++ b/apps/public/register/files/index.php
@@ -14,7 +14,7 @@ $parsed_certificate = openssl_x509_parse($raw_certificate);
 preg_match('/email:(.*?)(,|\z)/', $parsed_certificate['extensions']['subjectAltName'], $mail);
 
 // set uid to email address minus .xxx@mail.mil
-$uidArray = preg_split("(.mil@|.ctr@|.civ@)", $mail[1]) or preg_split("@", $mail[1]);
+$uidArray = preg_split("(.mil@|.ctr@|.civ@|@)", $mail[1]);
 $uid = $uidArray[0];
 
 // set name to an array with first, mi (if present) and last name as values
@@ -24,7 +24,7 @@ $name = explode(".", $uid);
 $first = ucfirst($name[0]);
 
 // set first name to last value of array, and capitalize it
-$last = ucfirst(end($name[2]));
+$last = ucfirst(end($name));
 
 // remove numbers from last name (if present)
 $last = preg_replace('/[0-9]+/', '', $last);
-- 
GitLab