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

Prevent 'data:' URLs from being prefixed #2044

Merged
merged 2 commits into from
Aug 31, 2015
Merged

Prevent 'data:' URLs from being prefixed #2044

merged 2 commits into from
Aug 31, 2015

Conversation

rblopes
Copy link
Contributor

@rblopes rblopes commented Aug 28, 2015

Fixes an issue where 'data:' URLs may get prefixed by #baseURL and #path properties making these URLs invalid.

Fixes an issue where 'data:' URLs may get prefixed by
`#baseURL` and `#path` properties making these URLs invalid.
@pnstickne
Copy link
Contributor

Don't forget about blob: prefixes, if those can make it in - as blobs are technically supported. I haven't looked at the different loading paths for awhile though.

The patterns to match are thus probably blob:, data:, http://, https://, //

(I would probably use a regular expression such as /^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/.)

Replaced the booleans with a matching expression. Now, URLs
beginning with the following patterns will be ignored:

- blob:
- data:
- http://
- https://
- //

As suggested by @pnstickne.
@rblopes
Copy link
Contributor Author

rblopes commented Aug 28, 2015

@pnstickne Thanks for suggesting these.

@photonstorm
Copy link
Collaborator

Yup, nice one.

photonstorm added a commit that referenced this pull request Aug 31, 2015
Prevent 'data:' URLs from being prefixed
@photonstorm photonstorm merged commit c10c7cd into phaserjs:dev Aug 31, 2015
@rblopes rblopes deleted the dont-prefix-data-urls branch March 14, 2016 16:50
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.

3 participants