strict comparison script scripting

Events happening in the community are now at Drupal community events on www.drupal.org.
ben.bunk's picture

Script Expressions and Strict Comparisons

When working with a script expression, strict comparisons might not work exactly like you would expect. For example, when strictly comparing for a TRUE value this will likely fail:

<?php
%input === TRUE
?>

Here is an example where I stumbled onto this:

<?php
function _multifactor_validate_pin($pin = NULL) {
  return
TRUE;
}
$script->addSet('success', '^_multifactor_validate_pin(%pin)');
$script->addGotoIf('success_message', '^%success === TRUE');
?>
Read more
Subscribe with RSS Syndicate content