Problem/Motivation

In some cases is useful to process base64 strings, for example when implementing a front controller for some CI or PaaS services which handles config value as base64 encoded strings. Also can be used to encode metadata into HTML attributes wich in other way may break your markup.

Steps to reproduce

N/A

Proposed resolution

Implement 2 new filters base64_encode and base64_decode which will act on string values.

Remaining tasks

  • Implement both filters on the "conversion" filters class
  • Add some tests

User interface changes

N/A

API changes

Update the docs with new filters.

Data model changes

N/A

Issue fork twig_tools-3246405

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

d70rr3s created an issue. See original summary.

d70rr3s’s picture

Issue summary: View changes
Status: Active » Needs review

  • PCate committed 3351002 on 8.x-1.x authored by d70rr3s
    Issue #3246405: Add filter to encode/decode base64 strings
    
pcate’s picture

Looks good. Thanks for including test coverage. I'll need to add documentation before creating a new release.

  • PCate committed 260e89f on 8.x-1.x
    Issue #3246405: Add test for base64_decode strict parameter.
    
  • PCate committed 47dae78 on 8.x-1.x
    Issue #3246405: Add hook help for base64_encode and base64_decode...
pcate’s picture

Status: Needs review » Reviewed & tested by the community
pcate’s picture

Status: Reviewed & tested by the community » Fixed

Added with new 8.x-1.4 release.

Status: Fixed » Closed (fixed)

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