From 5f8a3b3ef91b87e4c6edce12e85b71981a514eb2 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Mon, 20 May 2019 21:21:47 +0100 Subject: [PATCH] Catch uip with master dev # Conflicts: # www/js/app.js Former-commit-id: e093557d85de00c5af2acf5f343a29e714ad516a [formerly 274a9443e09bf1b216da33afcfd79a2605c2dc8f] Former-commit-id: 31cac1d904bd7208eaafa0721945ceabf00a3c8e --- www/js/app.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index 6180f840..9a9cc1a2 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -2214,15 +2214,22 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' // Compile some regular expressions needed to modify links // Pattern to find the path in a url var regexpPath = /^(.*\/)[^\/]+$/; - // Pattern to find a ZIM URL (with its namespace) - see http://www.openzim.org/wiki/ZIM_file_format#Namespaces - var regexpZIMUrlWithNamespace = /(?:^|\/)([-ABIJMUVWX]\/.+)/; - // Regex below finds images, scripts, stylesheets and media sources with ZIM-type metadata and image namespaces [kiwix-js #378] - // It first searches for ]*?\s)(?:src|href)(\s*=\s*["'])(?:\.\.\/|\/)+(?=[-IJ]\/)/ig; + var regexpTagsWithZimUrl = /(<(?:img|script|link)\b[^>]*?\s)(?:src|href)(\s*=\s*["'])(?:\.\.\/|\/)+(?=[-IJ]\/)/ig; + // Regex below tests the html of an article for active content [kiwix-js #466] + // It inspects every