From 78ed0c818af8e1e4b811b1fcf5b7f8f88ef7c7fa Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Mon, 7 Apr 2025 13:04:54 -0400 Subject: [PATCH] delete removeTrailingWhitespace function --- resources/lib/UnitySite.php | 11 ----------- webroot/panel/account.php | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/resources/lib/UnitySite.php b/resources/lib/UnitySite.php index 2bedf8a6..910e9f81 100644 --- a/resources/lib/UnitySite.php +++ b/resources/lib/UnitySite.php @@ -14,17 +14,6 @@ public static function redirect($destination) } } - public static function removeTrailingWhitespace($arr) - { - $out = array(); - foreach ($arr as $str) { - $new_string = rtrim($str); - array_push($out, $new_string); - } - - return $out; - } - public static function getGithubKeys($username) { $url = "https://api.github.com/users/$username/keys"; diff --git a/webroot/panel/account.php b/webroot/panel/account.php index c45602ca..22d0eae5 100644 --- a/webroot/panel/account.php +++ b/webroot/panel/account.php @@ -51,7 +51,7 @@ } if (!empty($added_keys)) { - $added_keys = UnitySite::removeTrailingWhitespace($added_keys); + $added_keys = array_map(trim, $added_keys); $totalKeys = array_merge($USER->getSSHKeys(), $added_keys); $USER->setSSHKeys($totalKeys, $OPERATOR); }