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

Incorrect regular expression match+replace for HTML injection, when no line breaks #34

Closed
danielweck opened this issue Dec 9, 2014 · 2 comments
Assignees

Comments

@danielweck
Copy link
Member

https://github.com/readium/SDKLauncher-OSX/blob/develop/LauncherOSX/PackageResourceServer.mm#L133

NSString *pattern = @"(<head.*>)";

To reproduce: any HTML file without line breaks results in the injected scripts being appended to the HTML, resulting in a WebView parsing error displayed at the top of the view.

Same problem in Android: readium/SDKLauncher-Android#45
and iOS: readium/readium-sdk#136

@danielweck
Copy link
Member Author

This regular expression works:
NSString *pattern = @"(<head[^>]*>)";

@danielweck
Copy link
Member Author

Fixed:
b7f2ef5

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

No branches or pull requests

1 participant