Skip to content

[5.8.17]: sha256 hash filter appends email #17885

@kaspar-allenbach

Description

@kaspar-allenbach

The Code: {{ 'email@domain.com' | hash('sha256') }}

returns:

0071b1f724985f4623f5b673c6cdeeb384b684d7ba22ed432c5108b365dafd78email@domain.com

Is this expected behavior? Why would the E-Mail be appended like this to the end of the hash?

I fixed the problem by doing this: {{ order.email | hash('sha256') | truncate(64, '') }}

But that's a bit shaky. (I. don't use it for any security related task)

Craft CMS version

5.8.17

PHP version

8.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions