Skip to content

Commit

Permalink
Limit the length of the keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Iunusov committed Nov 1, 2020
1 parent 01ee54a commit 94c0a8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/memcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function get($key)
{
connect();
}
$key = strtoupper($key);
$key = md5(strtoupper($key));
return $mc->get($key);
}

Expand All @@ -30,7 +30,7 @@ function set($key, $value)
connect();
}
$flags = 0;
$key = strtoupper($key);
$key = md5(strtoupper($key));
if ($mc->replace($key, $value, $flags, MEMCACHE_EXPIRY_SECONDS) == false)
{
return $mc->set($key, $value, $flags, MEMCACHE_EXPIRY_SECONDS);
Expand Down

0 comments on commit 94c0a8d

Please sign in to comment.