Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added safe_email filter for email field #480

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

NicoHood
Copy link
Contributor

Note: This requires grav 1.7.0-rc.18, as safe_email got fixed there:
getgrav/grav@068de42

Please have a look at #477 first. I will rebase afterwards.

Note: This requires grav 1.7.0-rc.18, as safe_email got fixed there:
getgrav/grav@068de42
@mahagr
Copy link
Member

mahagr commented Jan 15, 2021

Interesting... Hide emails in the forms...

@NicoHood
Copy link
Contributor Author

It only hides the default emails.

Example:
I have a website that lists multiple businesses. I am hiding their email with safe_email filter.
Now I add a /edit page where you can correct the data. The emails are prefilled. Of course this page can be grabbed by bots too, so to should also have this filter applied.

I also wanted to add this for the telephone field afterwards.

@NicoHood
Copy link
Contributor Author

Since the other PR got rejected: What about this one? I've simply copied the general field template, so everything should be still compatible. I know that emails are not iterable, maybe we can remove it in this field. What do you think?

@w00fz
Copy link
Member

w00fz commented Feb 9, 2021

I'm not sure how this will save after it has rendered with the safe_email filter applied?

@NicoHood
Copy link
Contributor Author

I dont understand your comment, sorry...

The filter will just obfuscate the email. I am using this for every email on my webpage and I noticed, that prefilled forms are lacking this filter. It does not hurt to have it there I think.

@w00fz
Copy link
Member

w00fz commented Feb 10, 2021

When it’s prefilled obfuscated and you submit again, it will submit obfuscated right?

Imagine you have a user profile with email field. When the profile loads and the raw value gets manipulated to show the safe version of it, it means that if I save the profile again it will now be storing the value obfuscated (in yaml or wherever it’s going to be used).
This is hardly a wanted behavior, most likely now sending an email to that obfuscated email will result in an invalid address error and so on.

That’s the issue I’m taking about. Am I missing something?

@NicoHood
Copy link
Contributor Author

It does not submit any obfuscated text. You can encode every html character like this. Did you try this? I guess you assumption was just wrong.

@rhukster
Copy link
Member

I'm going to test this one after the next release.

@NicoHood
Copy link
Contributor Author

NicoHood commented Apr 2, 2021

Any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants