Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberroland committed Oct 29, 2023
1 parent 14aa6c8 commit 807272b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lam/templates/account/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
}

// cleanup account containers in session
$cleanupCandidates = array();
$cleanupCandidates = [];
foreach ($_SESSION as $key => $value) {
if (strpos($key, $sessionAccountPrefix) === 0) {
if (str_starts_with($key, $sessionAccountPrefix)) {
$cleanupCandidates[] = $key;
}
$candidateCount = sizeof($cleanupCandidates);
Expand Down Expand Up @@ -151,10 +151,10 @@
function cleanDn(string $dn) : string {
$cleanDn = str_replace("\\'", '', $dn);
if ($dn == $cleanDn) {
if (substr($cleanDn, 0, 1) === "'") {
if (str_starts_with($cleanDn, "'")) {
$cleanDn = substr($cleanDn, 1);
}
if (substr($cleanDn, -1, 1) === "'") {
if (str_ends_with($cleanDn, "'")) {
$cleanDn = substr($cleanDn, 0, -1);
}
}
Expand Down

0 comments on commit 807272b

Please sign in to comment.