Skip to content

Commit fad07ad

Browse files
Fixed zset score edit bug
1 parent d979128 commit fad07ad

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "erik-dubbelboer/php-redis-admin",
33
"description": "Simple web interface to manage Redis databases.",
4-
"version": "1.1.1",
4+
"version": "1.1.2",
55
"license": "CC-BY-ND",
66
"homepage": "https://github.com/ErikDubbelboer/phpRedisAdmin",
77
"authors": [

edit.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,9 @@
7474

7575
// ZSet
7676
else if (($_POST['type'] == 'zset') && isset($_POST['score'])) {
77-
if ($_POST['value'] != $_POST['oldvalue']) {
78-
// The only way to edit a ZSet value is to add it and remove the old value.
79-
$redis->zRem(input_convert($_POST['key']), input_convert($_POST['oldvalue']));
80-
$redis->zAdd(input_convert($_POST['key']), input_convert($_POST['score']), input_convert($_POST['value']));
81-
}
77+
// The only way to edit a ZSet value is to add it and remove the old value.
78+
$redis->zRem(input_convert($_POST['key']), input_convert($_POST['oldvalue']));
79+
$redis->zAdd(input_convert($_POST['key']), input_convert($_POST['score']), input_convert($_POST['value']));
8280
}
8381

8482

0 commit comments

Comments
 (0)