Skip to content

Commit 265ab5c

Browse files
authored
Fix Problems with [0] as Index for TAN modes or TAN media
1 parent c3379b3 commit 265ab5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Samples/tanModesAndMedia.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
echo "Which one do you want to use? Index:\n";
2727
$tanModeIndex = trim(fgets(STDIN));
28-
if (empty($tanModeIndex) || !array_key_exists(intval($tanModeIndex), $tanModes)) {
28+
if (!is_numeric($tanModeIndex) || !array_key_exists(intval($tanModeIndex), $tanModes)) {
2929
echo 'Invalid index!';
3030
return;
3131
}
@@ -49,7 +49,7 @@
4949

5050
echo "Which one do you want to use? Index:\n";
5151
$tanMediumIndex = trim(fgets(STDIN));
52-
if (empty($tanMediumIndex) || !array_key_exists(intval($tanMediumIndex), $tanMedia)) {
52+
if (!is_numeric($tanMediumIndex) || !array_key_exists(intval($tanMediumIndex), $tanMedia)) {
5353
echo 'Invalid index!';
5454
return;
5555
}

0 commit comments

Comments
 (0)