Skip to content

Commit

Permalink
fix: remove unserialize() in old()
Browse files Browse the repository at this point in the history
I can't think of any use cases.
  • Loading branch information
kenjis committed Dec 9, 2021
1 parent 76ad2ad commit 18138fa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -813,11 +813,6 @@ function old(string $key, $default = null, $escape = 'html')
return $default;
}

// If the result was serialized array or string, then unserialize it for use...
if (is_string($value) && (strpos($value, 'a:') === 0 || strpos($value, 's:') === 0)) {
$value = unserialize($value);
}

return $escape === false ? $value : esc($value, $escape);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/system/CommonFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public function testOldInput()
$_GET = ['foo' => 'bar'];
$_POST = [
'bar' => 'baz',
'zibble' => serialize('fritz'),
'zibble' => 'fritz',
];

$response = new RedirectResponse(new App());
Expand Down

0 comments on commit 18138fa

Please sign in to comment.