Skip to content

Use json_encode with option JSON_UNESCAPED_SLASHES #317

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
wants to merge 3 commits into from

Conversation

dolmen
Copy link

@dolmen dolmen commented Dec 27, 2020

When encoding JSON, use option JSON_UNESCAPED_SLASHES which allows to disable a non-standard unnecessary over-encoding of / as \/ by json_encode.

This option of json_encode is available on PHP 5.4+.

@dolmen
Copy link
Author

dolmen commented Mar 24, 2021

@bshaffer Why label v6.0?

@bshaffer
Copy link
Collaborator

Because it will break backwards compatibility and drop a supported version of PHP, semantic versioning requires that we tag it for a new major version.

@Krisell
Copy link

Krisell commented Mar 24, 2021

That is not necessarily the case: https://medium.com/@sampart/semantic-versioning-when-you-change-the-required-programming-language-version-16a3a3555c95

However I agree that it's best to include such updates in a nearby major release if there is one.

@bshaffer
Copy link
Collaborator

@Krisell I meant changing the behavior of json_encode is what breaks backwards compatibility!

@dolmen
Copy link
Author

dolmen commented May 19, 2021

@bshaffer Why did you merged unrelated commits into my branch?

@bshaffer
Copy link
Collaborator

@bshaffer Why did you merged unrelated commits into my branch?

I updated your branch with changes made to master so that your PR is up to date.

When encoding JSON, use option JSON_UNESCAPED_SLASHES which allows to
disable a non-standard unnecessary over-encoding of '/' as '\/' by json_encode.

This option of json_encode is available on PHP 5.4+.
@dolmen dolmen force-pushed the JSON_UNESCAPED_SLASHES branch from 5540996 to 0835d8f Compare May 19, 2021 19:39
@dolmen
Copy link
Author

dolmen commented May 19, 2021

Rebased on top of master.

@bshaffer bshaffer mentioned this pull request Nov 3, 2021
6 tasks
@bshaffer
Copy link
Collaborator

bshaffer commented Nov 9, 2021

@dolmen it's been a while, but could you resubmit this branch to the v6.0 branch? If not, I can merge it into master, but I'd prefer to have all v6.0 changes separate if possible. Thank you!

@bshaffer bshaffer closed this Nov 10, 2021
This was referenced Nov 10, 2021
@dolmen
Copy link
Author

dolmen commented Jan 18, 2022

@bshaffer Have you heard about git cherry-pick?

@bshaffer
Copy link
Collaborator

@dolmen yes i have. Why do you ask?

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

Successfully merging this pull request may close these issues.

4 participants