Currently the module tries to divine several things about the encryption used and sets those as the value to use or uses the value provided by the caller if the value is empty. In the case of the $options it doesn't do that. $options are a little different from the other values since they are an array so I think it makes sense to merge them if there are some in the original encryption serialized array. I set it so the calling code is overridden by the saved values which is consistent with the way other values behave.

CommentFileSizeAuthor
#1 1834700_divine_options.patch740 bytesgreggles
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Status: Active » Needs review
FileSize
740 bytes
greggles’s picture

I forgot to really lay out the benefits of this.

Currently you often have to do:

$encrypted = encrypt($text, array('base64' => TRUE));
// Stuff.
$decrypted = decrypt($text, array('base64' => TRUE));

It would be nice if you could just do:

$encrypted = encrypt($text, array('base64' => TRUE));
// Stuff.
$decrypted = decrypt($text);

Status: Needs review » Needs work

The last submitted patch, 1834700_divine_options.patch, failed testing.

greggles’s picture

Status: Needs work » Needs review

#1: 1834700_divine_options.patch queued for re-testing.

greggles’s picture

Not sure why it failed at first. I filed #1834856: unexplained test failure on encrypt module (mcrypt extention issue?) about it.

I'll be trying this out more locally and will commit in ~2 weeks if there's no further advice.

greggles’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.