Skip to content

Text not filtered when setting the meta seoTitle #727

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

Closed
ashleybaird opened this issue Aug 24, 2020 · 1 comment
Closed

Text not filtered when setting the meta seoTitle #727

ashleybaird opened this issue Aug 24, 2020 · 1 comment
Labels

Comments

@ashleybaird
Copy link

ashleybaird commented Aug 24, 2020

Describe the bug

When you set the seoTitle using seomatic.meta.seoTitle, the text inside of that is not filtered. If the title is set using user input, that input can run functionality and display it in the payload.

To reproduce

  1. Use seomatic.meta.seoTitle and set the title with functionality such as {{7*7}}
  2. Reload the page and look to see what the title is in the payload in the Web Inspector

Expected behaviour

The text should be a string where no functionality is run.

Screenshots

Versions

  • Plugin version: 3.3.16
  • Craft version: 3.3.19
@khalwat
Copy link
Collaborator

khalwat commented Aug 24, 2020

This is normal and expected behavior. SEOmatic parses the values it uses as Twig templates. In places where you set this manually to user input, you'll need to filter it as appropriate.

I've added a Twig function seomatic.helper.sanitizeUserInput to make that easier for you: 93ceb1a

@khalwat khalwat closed this as completed Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants