Fixed for banner-codes, that does not enclose the src-attribute in quotes
authorKai Moritz <kai@coolibri.de>
Tue, 30 Oct 2012 13:47:43 +0000 (14:47 +0100)
committerKai Moritz <kai@juplo.de>
Wed, 27 Feb 2013 18:29:50 +0000 (19:29 +0100)
The HTML-standard allows, to write the attributes of an tag without
enclosing quotes. That was not considered in the regular expression, that
parses the <script>-tag.

openx.js

index bfd49a5..a442f0d 100644 (file)
--- a/openx.js
+++ b/openx.js
         }
         else {
           /** Remember iinline-code, if present */
-          src = result[1]
+          src = result[1] + ' ' // << simplifies the following regular expression: the string ends with a space in any case, so that the src-URL cannot be followed by the end of the string emediately!
           inline = result[2];
           /** Strip all text up to and including "</script>" from OA_output[id] */
           OA_output[id] = OA_output[id].slice(result[0].length,OA_output[id].length);
-          result = /src\s*=\s*['"]([^'"]*)['"]/i.exec(src);
+          result = /src\s*=\s*['"]?([^'"]*)['"]?\s/i.exec(src);
           if (result == null) {
             /** script-tag with inline-code: execute inline-code! */
             result = /^\s*<.*$/m.exec(inline);