From 45e279d7bd19d77a34d1fc381756f731a09dd6be Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Fri, 19 Oct 2012 07:07:32 +0000
Subject: [PATCH] Do not place "extra" headers in the main hdr object as this
 can cause conflict with SMB and other Synchronet-specific properties. 
 Instead, add them to an extra_headers object.

Fixes a weird an unlikely bug encountered in rec.radio.cb spam.
---
 exec/load/newsutil.js | 4 ++--
 exec/newslink.js      | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/exec/load/newsutil.js b/exec/load/newsutil.js
index 1ccdbb646f..a2b346ea27 100644
--- a/exec/load/newsutil.js
+++ b/exec/load/newsutil.js
@@ -166,7 +166,7 @@ function parse_news_header(hdr, line)
 		default:
 			if(hdr.field_list==undefined)
 				hdr.field_list=new Array();
-			hdr[line.toLowerCase()]=
+			hdr.extra_headers[line.toLowerCase()]=
 				{	type: RFC822HEADER, 
 					get data() { return(this.hdr_name+': '+this.hdr_data); },
 					set data(v) { 
@@ -182,7 +182,7 @@ function parse_news_header(hdr, line)
 					hdr_data: data,
 					toString: function() { return this.hdr_data; }
 				};
-			hdr.field_list.push(hdr[line.toLowerCase()]);
+			hdr.field_list.push(hdr.extra_headers[line.toLowerCase()]);
 			break;
 	}
 }
diff --git a/exec/newslink.js b/exec/newslink.js
index 1908b11cef..d77dd1f0f7 100644
--- a/exec/newslink.js
+++ b/exec/newslink.js
@@ -774,10 +774,10 @@ for(i in area) {
 		for(h in hfields)
 			parse_news_header(hdr,hfields[h]);	// from newsutil.js
 
-		if(hdr["nntp-posting-host"]!=undefined 
-			&& (system.trashcan("ip", hdr["nntp-posting-host"]) 
-				|| system.trashcan("ip-silent", hdr["nntp-posting-host"]))) {
-			print("!Filtered IP address in NNTP-Posting-Host header field: " + hdr["nntp-posting-host"]);
+		if(hdr.extra_headers["nntp-posting-host"]!=undefined 
+			&& (system.trashcan("ip", hdr.extra_headers["nntp-posting-host"]) 
+				|| system.trashcan("ip-silent", hdr.extra_headers["nntp-posting-host"]))) {
+			print("!Filtered IP address in NNTP-Posting-Host header field: " + hdr.extra_headers["nntp-posting-host"]);
 			subpending--;
 			continue;
 		}
-- 
GitLab