Search code examples
cakephpcakephp-2.0encryptionblowfish

Blowfish Cipher Behavior doesn't work in Cakephp 2+


The Cipher Behavior on The Bakery doesn't work after updating to Cakephp 2+. Receiving the error Fatal error: Call to undefined function getmicrotime() anytime the behavior is triggered.


Solution

  • On line 139 of the behavior, getMicrotime() is called. srand(getMicrotime()*1000); getMicrotime() was removed from Cakephp 2.0.

    Just change getMicrotime() to microtime(true) and the behavior will work normally.