Welcome Guest, Not a member yet? Register   Sign In
CI 3 to CI 4 Encryption Compability
#6

(This post was last modified: 02-18-2023, 01:51 PM by objecttothis. Edit Reason: clarity )

(07-24-2022, 04:54 AM)ardimardiana Wrote: i have figure it out hot to resolve this problem. so. what i am doing is. take / copy Codeigniter 3 encryption class

@ardimardiana

I'm trying to do the same thing you've described here, but the CI3 Encryption class has a number of dependencies on functions in the CI3 \system\core\common.php library that don't exist in CI4 in the same way... Are there other files you brought over as well? It seems that copy over and rename isn't doing it.

Nevermind... your instructions are missing a key change though.  In the constructor you need to change
PHP Code:
if ( ! isset($this->_key) && self::strlen($key config_item('encryption_key')) > 0

to
PHP Code:
if ( ! isset($this->_key) && self::strlen($key config('Encryption')->key) > 0

Then it will work.
Reply


Messages In This Thread
RE: CI 3 to CI 4 Encryption Compability - by objecttothis - 02-18-2023, 01:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB