@@ -10,19 +10,20 @@ function Exclusion(pattern) {
1010}
1111
1212function CookieRule ( host , cookiename ) {
13- this . host = host
13+ this . host = host ;
1414 this . host_c = new RegExp ( host ) ;
1515 this . name = cookiename ;
1616 this . name_c = new RegExp ( cookiename ) ;
1717}
1818
1919localPlatformRegexp = new RegExp ( "firefox" ) ;
2020ruleset_counter = 0 ;
21- function RuleSet ( name , match_rule , default_off , platform ) {
21+ function RuleSet ( name , xmlName , match_rule , default_off , platform ) {
2222 this . id = "httpseR" + ruleset_counter ;
2323 ruleset_counter += 1 ;
2424 this . on_by_default = true ;
2525 this . name = name ;
26+ this . xmlName = xmlName ;
2627 //this.ruleset_match = match_rule;
2728 this . notes = "" ;
2829 if ( match_rule ) this . ruleset_match_c = new RegExp ( match_rule )
@@ -254,6 +255,12 @@ const RuleWriter = {
254255 // The root of the XML tree has a name, which means it should be single a ruleset...
255256 this . parseOneRuleset ( xmlblob , rule_store , file ) ;
256257 } else {
258+ if ( xmlblob . @gitcommitid == xmlblob . @nonexistantthing ) {
259+ this . log ( DBUG , "gitcommitid tag not found in <xmlruleset>" ) ;
260+ rule_store . gitcommitid = "HEAD" ;
261+ } else {
262+ rule_store . GITCommitID = xmlblob . @gitcommitid ;
263+ }
257264 // The root of the XML tree should be a <rulesetlibrary> with many
258265 // <ruleset> children
259266 var lngth = xmlblob . ruleset . length ( ) ; // premature optimisation
@@ -280,7 +287,7 @@ const RuleWriter = {
280287 if ( xmlruleset . @match_rule . length ( ) > 0 ) match_rl = xmlruleset . @match_rule ;
281288 if ( xmlruleset . @default_off . length ( ) > 0 ) dflt_off = xmlruleset . @default_off ;
282289 if ( xmlruleset . @platform . length ( ) > 0 ) platform = xmlruleset . @platform ;
283- var rs = new RuleSet ( xmlruleset . @name , match_rl , dflt_off , platform ) ;
290+ var rs = new RuleSet ( xmlruleset . @name , xmlruleset . @ f , match_rl , dflt_off , platform ) ;
284291
285292 if ( xmlruleset . target . length ( ) == 0 ) {
286293 var msg = "Error: As of v0.3.0, XML rulesets require a target domain entry," ;
0 commit comments