xmltv/lib Augment.pm,1.13,1.14

Nick Morrott <[email protected]> Tue, 12 Jul 2016 01:29:00 +0000
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/lib
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25910/lib

Modified Files:
	Augment.pm 
Log Message:
Update process_replacement_genres()

* quote all metacharacters (regular + wildcard rule strings)

  We need to ensure that titles in user #6 rules have all metacharacters
  escaped before being used to match against a programme title.

  For non-wildcard matches we can simply quote the whole title string.

  For wildcard matches we quotemeta($key) and then un-escape the regex
  placeholder chars (%%), before substituting them with the wildcard regex
  chars (.*?)


Index: Augment.pm
===================================================================
RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Augment.pm	12 Jul 2016 01:28:46 -0000	1.13
--- Augment.pm	12 Jul 2016 01:28:58 -0000	1.14
***************
*** 2205,2211 ****
  			_d(4,"\t $line, $key, $value");
  
! 			my $_key = $self->replace_wild($key);
  
!       if ($prog->{'_title'} =~ m/\Q$_key\E/i ) {
  				#_d(4,dd(4,$prog->{'_genres'}));
  
--- 2205,2212 ----
  			_d(4,"\t $line, $key, $value");
  
! 			my $qr_key = $self->replace_wild($key);
!             _d(5,"\t $line, $qr_key, $value");
  
!       if ($prog->{'_title'} =~ $qr_key ) {
  				#_d(4,dd(4,$prog->{'_genres'}));
  
***************
*** 3556,3562 ****
  	my ($self, $key) = @_;
  	if ($key =~ m/%%/) {
! 		$key =~ s/%%/\.\*\?/g
  	}
! 	return "^$key\$";
  }
  
--- 3557,3568 ----
  	my ($self, $key) = @_;
  	if ($key =~ m/%%/) {
!         $key = quotemeta($key);
!         $key =~ s/\\%\\%/%%/g;
! 		$key =~ s/%%/\.\*\?/g;
!         return qr/^$key$/;
  	}
!     else {
!         return qr/^\Q$key\E$/;
!     }
  }
  


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev