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

Escape title used in an HTML attribute. #85

Closed
wants to merge 2 commits into from

Conversation

arkhi
Copy link

@arkhi arkhi commented Nov 14, 2020

This closes #84.

(Also use ellipsis instead of ...)

Also use ellipsis instead of `...`.
@ricardo118
Copy link
Collaborator

can also be solved using 'title' => htmlspecialchars($child->menu()), or 'title' => strip_tags($child->menu()),
on the file
system\src\Grav\Common\Flex\Types\Pages\PageIndex.php Line 492

- Also escape any character that could be problematic in the attribute.
- Escape `<script>` tags from _title_ only when not in the attribute.
@arkhi
Copy link
Author

arkhi commented Nov 15, 2020

can also be solved using 'title' => htmlspecialchars($child->menu()), or 'title' => strip_tags($child->menu()),
on the file
system\src\Grav\Common\Flex\Types\Pages\PageIndex.php Line 492

Wouldn’t that cause the title to be displayed incorrectly or without its semantic?

@w00fz
Copy link
Member

w00fz commented Nov 16, 2020

This is already fixed with getgrav/grav@1396525

@mahagr
Copy link
Contributor

mahagr commented Nov 17, 2020

Quick comment here, too: title is a text field, it should in no circumstances accept HTML. The frontend themes should also escape it.

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.

Escape variables used in attributes
4 participants