Fix incorrect rule selection when deleting rules with same long URL

This commit is contained in:
Alejandro Celaya
2024-03-03 12:59:58 +01:00
parent 8751d6c315
commit 63c533fa62
2 changed files with 5 additions and 3 deletions

View File

@@ -168,7 +168,9 @@ class RedirectRuleHandler implements RedirectRuleHandlerInterface
{
$choices = [];
foreach ($currentRules as $index => $rule) {
$choices[$rule->longUrl] = $index + 1;
$priority = $index + 1;
$key = sprintf('%s - %s', $priority, $rule->longUrl);
$choices[$key] = $priority;
}
$resp = $io->choice($message, array_flip($choices));