You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicfunction save($data, $id, $tags = array(), $specificLifetime = false)
{
if (!$this->_redis)
returnfalse;
$lifetime = $this->getLifetime($specificLifetime);
if (!$tags || !count($tags))
$tags = array('');
if (is_string($tags))
$tags = array($tags);
if (!count($tags)) {
...
In this block of code if tags is not set or an empty array it will always be set to an array containing one empty string. This means that the code block for set/setex is never followed when no tags are present.
Change to initialising it to an empty array. This is still slightly redundant as the function declaration has a default value for $tags.
In this block of code if tags is not set or an empty array it will always be set to an array containing one empty string. This means that the code block for set/setex is never followed when no tags are present.
Change to initialising it to an empty array. This is still slightly redundant as the function declaration has a default value for $tags.
The text was updated successfully, but these errors were encountered: