Skip to content
This repository was archived by the owner on Apr 7, 2021. It is now read-only.

Commit 2952310

Browse files
committed
cleaned up fix for #19
1 parent 2aecf6b commit 2952310

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Traits/HasEncryptedAttributes.php

+3
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ public function decryptedAttribute($value)
173173
throw_if(! array_key_exists('stop', $characters), DecryptException::class, 'Cannot decrypt model attribute not originally encrypted by this package!');
174174

175175
$offset = strpos($value, $characters['stop']['string']);
176+
177+
throw_if($offset === false, DecryptException::class, "Cannot decrypt model attribute with no package header!");
178+
176179
$value = substr($value, $offset);
177180

178181
return Crypt::decrypt($value);

0 commit comments

Comments
 (0)