Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion gravity-forms/gw-advanced-merge-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@ public function handle_field_modifiers( $value, $input_id, $modifier, $field, $r
}

return $this->generate_gravatar($value, $modifiers);
case 'base64':
return base64_encode( $value );
break;
Comment on lines +554 to +556
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove unreachable break statement.

The break on line 517 is unreachable since line 516 returns. This is consistent with other cases in this switch statement (e.g., lines 467, 469, 471) that return without a subsequent break.

Apply this diff:

 				case 'base64':
 					return base64_encode( $value );
-					break;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
case 'base64':
return base64_encode( $value );
break;
case 'base64':
return base64_encode( $value );
🤖 Prompt for AI Agents
In gravity-forms/gw-advanced-merge-tags.php around lines 515 to 517, remove the
unreachable `break;` after the `return base64_encode( $value );` in the 'base64'
switch case — simply delete the `break;` line so the case mirrors other
return-only cases and avoids dead code.

}
}

Expand All @@ -527,7 +530,7 @@ public function mask_value( $value ) {

public function parse_modifiers( $modifiers_str ) {

preg_match_all( '/([a-z_]+)(?:(?:\[(.+?)\])|,?)/i', $modifiers_str, $modifiers, PREG_SET_ORDER );
preg_match_all( '/([a-z0-9_]+)(?:(?:\[(.+?)\])|,?)/i', $modifiers_str, $modifiers, PREG_SET_ORDER );
$parsed = array();

foreach ( $modifiers as $modifier ) {
Expand Down