-
-
Save anonymous/21fbd9127158a2c79e94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):075:0> foo = File.read('307839-2.xhtml') | |
=> "<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>Testcase bug - Evil mrow:hover testcase crashes Mozilla</title>\r\n<style type=\"text/css\">\r\n</html>\r\n" | |
irb(main):076:0> bar = File.read('replace.txt') | |
=> "'canPlayType':{'ret':'none', 'args':[{'choice':['video/mp4; codecs=\\'avc1.42E01E\\'', 'video/ogg; codecs=\\'theora\\'']}]},\n" | |
irb(main):077:0> print foo.sub(/<head>/m, "\0\n<script type='text/javascript'>" + bar + "</script>") | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<script type='text/javascript'>'canPlayType':{'ret':'none', 'args':[{'choice':['video/mp4; codecs= | |
<title>Testcase bug - Evil mrow:hover testcase crashes Mozilla</title> | |
<style type="text/css"> | |
</html> | |
avc1.42E01E | |
<title>Testcase bug - Evil mrow:hover testcase crashes Mozilla</title> | |
<style type="text/css"> | |
</html> | |
', 'video/ogg; codecs= | |
<title>Testcase bug - Evil mrow:hover testcase crashes Mozilla</title> | |
<style type="text/css"> | |
</html> | |
theora | |
<title>Testcase bug - Evil mrow:hover testcase crashes Mozilla</title> | |
<style type="text/css"> | |
</html> | |
']}]}, | |
</script> | |
<title>Testcase bug - Evil mrow:hover testcase crashes Mozilla</title> | |
<style type="text/css"> | |
</html> | |
=> nil | |
irb(main):078:0> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment