File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -266,8 +266,8 @@ function self.isXML(str, content)
266
266
local str = str or ' '
267
267
local content = content or ' '
268
268
local xmlPattern = ' ^%s*%<.+%>%s*$'
269
- local ret = str :match (xmlPattern ) == str or content :find (' application/xml' ) or content :find (' text/xml' )
270
- return ret ~= nil
269
+ local ret = ( str :match (xmlPattern ) == str or content :find (' application/xml' ) or content :find (' text/xml' )) and not ( str : sub ( 1 , 30 ): find ( ' DOCTYPE html ' ) )
270
+ return ret
271
271
272
272
end
273
273
@@ -297,11 +297,10 @@ function self.fromXML(xml, fallback)
297
297
if (ok ) then
298
298
return results
299
299
end
300
- self .log (' Error parsing xml to Lua table: ' .. _ .str (results ), self .LOG_ERROR )
300
+ -- self.log('Error parsing xml to Lua table: ' .. _.str(results), self.LOG_ERROR)
301
301
else
302
302
self .log (' Error parsing xml to LUA table: (invalid xml string) ' .. _ .str (xml ) , self .LOG_ERROR )
303
303
end
304
-
305
304
return fallback
306
305
307
306
end
You can’t perform that action at this time.
0 commit comments