-
Notifications
You must be signed in to change notification settings - Fork 73
Type Error: won't decrypt float #18
Comments
@ITwrx do you have some code I can quickly reproduce the issue with? |
sorry, i don't remember where this was in my app and i already switched back to elocrypt but it would have been using l5.5. also, to reproduce, you should be able to simply add a testing property to any model, set the column data type to varchar in mariadb. save a float in it using laravel-database-encryption and l5.5 and then try and echo it in a page. unless it was just me somehow. :) |
I have the same problem occuring except it's for an integer, not float. |
@ITwrx / @Tyldar pushed a potential fix to https://github.com/austinheap/laravel-database-encryption/tree/2aecf6b22f162531a1e2bd2f536a49c7cee89f3b. Unit tests for Let me know how it goes, going to close the issue unless additional issues get reported back. |
i have a column with existing data (a float) in it. i converted the mariadb data type from decimal to varchar. installed laravel-database-encryption, re-saved the data in my app and laravel-database-encryption was able to encrypt it. however, when i went to view the data in my app again, laravel-database-encryption wasn't able to decrypt it. The error can probably speak for itself.
Type error: Return value of App\Models\Entry::decryptedAttribute() must be of the type string or null, float returned
…/vendor/austinheap/laravel-database-encryption/src/Traits/HasEncryptedAttributes.php 173
i understand that the data needs to be stored as some type of text in the database and it is, but i need to be able to encrypt/decrypt any data type. Maybe i'm missing something? FYI, i just reinstalled elocrypt and it handles this same scenario fine.
thanks
The text was updated successfully, but these errors were encountered: