Automattic / wp-memcached

Memcached Object Cache for WordPress.
https://wordpress.org/plugins/memcached/
GNU General Public License v2.0
160 stars 55 forks source link

Key rotation does not work properly on 32-bit php #15

Open nmcgann opened 7 years ago

nmcgann commented 7 years ago

A bit of an edge case now, but intval( microtime( true ) * 1e6 ) in rotate_site_keys() and rotate_global_keys() can overflow in 32-bit integers and the memcached daemon throws errors if the Memcache::increment method is called on a negative value.

Checking for PHP_INT_SIZE == 4 and just using time() instead of microtime() is a quick fix.