Skip to content

Commit ad23416

Browse files
committed
Bugfix: only delete original hash member during edit if hash key is being changed.
1 parent 19cd002 commit ad23416

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

edit.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@
3838
die('ERROR: Your hash key is to long (max length is '.$config['maxkeylen'].')');
3939
}
4040

41-
$redis->hSet($_POST['key'], $_POST['hkey'], $_POST['value']);
42-
43-
if ($edit) {
41+
if ($edit && !$redis->hExists($_POST['key'], $_POST['hkey'])) {
4442
$redis->hDel($_POST['key'], $_GET['hkey']);
4543
}
4644

45+
$redis->hSet($_POST['key'], $_POST['hkey'], $_POST['value']);
4746
}
4847

4948
// List

0 commit comments

Comments
 (0)