Skip to content

Commit ef8ff75

Browse files
committed
Merge branch 'master' into pulls/TMP-ss4-upgrade
* master: Update README.md Update README.md Cast the value to decrypt to a string to prevent type-errors # Conflicts: # README.md
2 parents 932ad86 + bb76999 commit ef8ff75

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ In your `DataObject`, create new database fields using an encrypted field type.
4040

4141
For example:
4242

43-
```
43+
```php
4444
use Madmatt\EncryptAtRest\FieldType\EncryptedVarchar;
4545

4646
class SecureDataObject extends DataObject {

src/FieldType/EncryptedText.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public function setValue($value, $record = null, $markChanged = true)
3535

3636
public function getDecryptedValue($value)
3737
{
38+
// Type hardening for PHP 8.1+
39+
$value = (string)$value;
3840
// Test if we're actually an encrypted value;
3941
if (ctype_xdigit($value) && strlen($value) > 130) {
4042
try {

0 commit comments

Comments
 (0)