Skip to content

Conversation

@8ctopus
Copy link
Contributor

@8ctopus 8ctopus commented Dec 25, 2025

Add draft to attempt to resolve #1443

There are no specific tests yet, and there are improvements that can be made, I just want to get your approval before I polish things up.

@coveralls
Copy link

coveralls commented Dec 25, 2025

Coverage Status

coverage: 68.727% (-0.5%) from 69.191%
when pulling f724347 on 8ctopus:css-string-escaping
into 0ae1fde on MyIntervals:main.

Copy link
Collaborator

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be significantly slower looping through the string rather than using the built-in function (particularly as some strings may be base64-encoded images). Also this is reimplementing some of what addslashes() does.

Wouldn't it be simpler (and more efficient) to use addslashes() as before, then do a str_replace() to replace \' with ' or \" with " depending on the string quoting type?

@JakeQZ
Copy link
Collaborator

JakeQZ commented Dec 30, 2025

Wouldn't it be simpler (and more efficient) to use addslashes() as before, then do a str_replace() to replace \' with ' or \" with " depending on the string quoting type?

PS. I agree with adding a separate method to do this.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

escaping data:image when not required

4 participants