Skip to content

Commit 5423ca9

Browse files
committed
Fixes
1 parent 25d3708 commit 5423ca9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Dashboards/APCu/APCuTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ private function viewKey(): string {
133133
public function saveKey(): void {
134134
$key = Http::post('key', '');
135135
$expire = Http::post('expire', 0);
136-
$old_key = (string) Http::post('old_key', '');
136+
$old_key = Http::post('old_key', '');
137137
$value = Value::converter(Http::post('value', ''), Http::post('encoder', ''), 'save');
138138

139-
if ($old_key !== $key) {
139+
if ($old_key !== '' && $old_key !== $key) { // @phpstan-ignore-line
140140
apcu_delete($old_key);
141141
}
142142

src/Dashboards/Memcached/MemcachedTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ private function viewKey(): string {
153153
public function saveKey(): void {
154154
$key = Http::post('key', '');
155155
$expire = Http::post('expire', 0);
156-
$old_key = (string) Http::post('old_key', '');
156+
$old_key = Http::post('old_key', '');
157157
$value = Value::converter(Http::post('value', ''), Http::post('encoder', ''), 'save');
158158

159-
if ($old_key !== $key) {
159+
if ($old_key !== '' && $old_key !== $key) { // @phpstan-ignore-line
160160
$this->memcached->delete($old_key);
161161
}
162162

0 commit comments

Comments
 (0)