Jump to content
thirty bees forum
  • 0

toString method in Blowfish class to fix Cookie problem


Wesley

Question

Hello, 

A few days ago I migrated a test clone of my website to thirtybees, I had some problems with my Blowfish and Cookie class when trying to acces the BO and FO. 

Error

PHP Recoverable fatal error:  Object of class Blowfish could not be converted to string in /home/shops/public_html/testclone/classes/Cookie.php on line 282

To resolve this error I created a toString method in both my Blowfish class and my CryptBlowfish class. It got rid of the errors and everything is working fine, but i'm wondering if this is a good solution.

Could anyone tell me if this is fine or if I could apply a diffrent fix?

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1
12 minutes ago, Wesley said:

i'm wondering if this is a good solution.

Could anyone tell me if this is fine or if I could apply a diffrent fix?

 

Sorry, that is not a best solution. It is just a cover-up of a bigger problem: there is something in your system that is trying to set Blowfish object inside your Cookie. There used to be a _cipherTool property inside Cookie class. This protected property used to hold cookie encryptor instance. 

I bet you have some Cookie override that tries to set this (now not existing) property, which in turn causes the fatal error.

You can try this:

  1. revert your fix
  2. edit class Cookie.php
  3. at the very beginning, add this line:
protected $_cipherTool;

That should fix your problem. Anyway, this is a core compatibility issue, and it should be handled in the core. 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...