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

[Bug] Invalid JSON if string contains " or \ in multiple phtml files #87

Open
wubinworks opened this issue Dec 19, 2024 · 1 comment · May be fixed by #88
Open

[Bug] Invalid JSON if string contains " or \ in multiple phtml files #87

wubinworks opened this issue Dec 19, 2024 · 1 comment · May be fixed by #88

Comments

@wubinworks
Copy link

(Thank you for providing an open source solution of Rich Snippets)

File

breadcrumbs.phtml#L36

Reproduce

Create a category and let its name contains " or \.

Output(invalid JSON):

{
    ...
    "item": {
        "@id": "",
        "name": "Some\Category\Name"
    }
    ...
}

Expected result

" or \ should be escaped to \" or \\

@vseager vseager linked a pull request Dec 20, 2024 that will close this issue
@wubinworks
Copy link
Author

The fix is not enough, please read this comment.

@wubinworks wubinworks changed the title [Bug] Invalid JSON Breadcrumbs Rich Snippets when $crumbInfo['label'] contains " or \ [Bug] Invalid JSON ~~Breadcrumbs Rich Snippets when $crumbInfo['label']~~ if string contains " or \ in multiple phtml files Dec 25, 2024
@wubinworks wubinworks changed the title [Bug] Invalid JSON ~~Breadcrumbs Rich Snippets when $crumbInfo['label']~~ if string contains " or \ in multiple phtml files [Bug] Invalid JSON if string contains " or \ in multiple phtml files Dec 25, 2024
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 a pull request may close this issue.

1 participant