From 49c3b4e84e10db8ccb20966411ef6208c745e32e Mon Sep 17 00:00:00 2001 From: patrik Date: Thu, 29 Mar 2012 20:45:04 +0000 Subject: [PATCH] Adjusted link patterns to exclude leading and trailing whitespace in the link extractor parsing function --- nselib/httpspider.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nselib/httpspider.lua b/nselib/httpspider.lua index 041b3f0df..1657a0a17 100644 --- a/nselib/httpspider.lua +++ b/nselib/httpspider.lua @@ -223,11 +223,11 @@ LinkExtractor = { parse = function(self) local links = {} local patterns = { - '[hH][rR][eE][fF]%s*=%s*[\'"](%s*[^"^\']+%s*)[\'"]', + '[hH][rR][eE][fF]%s*=%s*[\'"]%s*([^"^\']-)%s*[\'"]', '[hH][rR][eE][fF]%s*=%s*([^\'\"][^%s>]+)', - '[sS][rR][cC]%s*=%s*[\'"](%s*[^"^\']+%s*)[\'"]', + '[sS][rR][cC]%s*=%s*[\'"]%s*([^"^\']-)%s*[\'"]', '[sS][rR][cC]%s*=%s*([^\'\"][^%s>]+)', - '[aA][cC][tT][iI][oO][nN]%s*=%s*[\'"](%s*[^"^\']+%s*)[\'"]', + '[aA][cC][tT][iI][oO][nN]%s*=%s*[\'"]%s*([^"^\']+%s*)[\'"]', } local base_hrefs = {