[interchange-cvs] interchange - heins modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Mon Jun 28 17:37:51 EDT 2004


User:      heins
Date:      2004-06-28 21:37:50 GMT
Modified:  lib/Vend Util.pm Interpolate.pm
Log:
Back out unintentional commit

Revision  Changes    Path
2.74      +11 -25    interchange/lib/Vend/Util.pm


rev 2.74, prev_rev 2.73
Index: Util.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Util.pm,v
retrieving revision 2.73
retrieving revision 2.74
diff -u -r2.73 -r2.74
--- Util.pm	28 Jun 2004 21:25:27 -0000	2.73
+++ Util.pm	28 Jun 2004 21:37:50 -0000	2.74
@@ -1,6 +1,6 @@
 # Vend::Util - Interchange utility functions
 #
-# $Id: Util.pm,v 2.73 2004/06/28 21:25:27 mheins Exp $
+# $Id: Util.pm,v 2.74 2004/06/28 21:37:50 mheins Exp $
 # 
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -87,7 +87,7 @@
 use Vend::File;
 use subs qw(logError logGlobal);
 use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION = substr(q$Revision: 2.73 $, 10);
+$VERSION = substr(q$Revision: 2.74 $, 10);
 
 my $Eval_routine;
 my $Eval_routine_file;
@@ -530,7 +530,7 @@
 
     $r = '';
     for ($i = 0;  $i < $len;  ++$i) {
-		$r .= substr($random_chars, int(rand(length($random_chars))), 1);
+	$r .= substr($random_chars, int(rand(length($random_chars))), 1);
     }
     $r;
 }
@@ -707,7 +707,7 @@
 		close(MVLOGDATA) or die "close\n";
     };
     if ($@) {
-		logError ("Could not %s log file '%s': %s\nto log this data:\n%s",
+		::logError ("Could not %s log file '%s': %s\nto log this data:\n%s",
 				$@,
 				$file,
 				$!,
@@ -1041,7 +1041,7 @@
 	$file =~ s#\s+$##;
 	$file =~ s#\.html?$##;
 	if($file =~ m{\.\.} and $file =~ /\.\..*\.\./) {
-		logError( "Too many .. in file path '%s' for security.", $file );
+		::logError( "Too many .. in file path '%s' for security.", $file );
 		$file = find_special_page('violation');
 	}
 	$file =~ s#//+#/#g;
@@ -1420,7 +1420,7 @@
 		}
 		if($Vend::Cfg->{UserDB} and $Vend::Cfg->{UserDB}{log_failed}) {
 			my $besthost = $CGI::remote_host || $CGI::remote_addr;
-			logError("auth error host=%s ip=%s script=%s page=%s",
+			::logError("auth error host=%s ip=%s script=%s page=%s",
 							$besthost,
 							$CGI::remote_addr,
 							$CGI::script_name,
@@ -1683,18 +1683,7 @@
 
 sub logError {
     my $msg = shift;
-	return unless $Vend::Cfg;
-
-	my $opt;
-	if(ref $_[0]) {
-		$opt = shift(@_);
-	}
-	else {
-		$opt = {};
-	}
-
-	$opt->{file} ||= $Vend::Cfg->{ErrorFile};
-
+	return unless defined $Vend::Cfg;
 	if(@_) {
 		$msg = errmsg($msg, @_);
 	}
@@ -1705,11 +1694,11 @@
 
     $msg = format_log_msg($msg) unless $msg =~ s/^\\//;
 
-	$Vend::Errors .= $msg
-		if $Vend::Cfg->{DisplayErrors} || $Global::DisplayErrors;
+	$Vend::Errors .= $msg if ($Vend::Cfg->{DisplayErrors} ||
+							  $Global::DisplayErrors);
 
     eval {
-		open(MVERROR, ">> $opt->{file}")
+		open(MVERROR, ">>$Vend::Cfg->{ErrorFile}")
 											or die "open\n";
 		lockfile(\*MVERROR, 1, 1)		or die "lock\n";
 		seek(MVERROR, 0, 2)				or die "seek\n";
@@ -1722,7 +1711,7 @@
 		logGlobal ({ level => 'info' },
 					"Could not %s error file %s: %s\nto report this error: %s",
 					$@,
-					$opt->{file},
+					$Vend::Cfg->{ErrorFile},
 					$!,
 					$msg,
 				);
@@ -1742,12 +1731,9 @@
 # First argument should be log type (see above map).
 # Rest of arguments are same as if calling log routine directly.
 sub logOnce {
-	my $tag = join "", @_;
-	return if exists $logOnce_cache{$tag};
+	return if exists $logOnce_cache{"@_"};
 	my $log_sub = $log_sub_map{ lc(shift) } || $log_sub_map{error};
-	my $status = $log_sub->(@_);
-	$logOnce_cache{$tag} = 1;
-	return $status;
+	$log_sub->(@_) and ++$logOnce_cache{"@_"};
 }
 
 



2.212     +4 -26     interchange/lib/Vend/Interpolate.pm


rev 2.212, prev_rev 2.211
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.211
retrieving revision 2.212
diff -u -r2.211 -r2.212
--- Interpolate.pm	28 Jun 2004 21:25:26 -0000	2.211
+++ Interpolate.pm	28 Jun 2004 21:37:50 -0000	2.212
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.211 2004/06/28 21:25:26 mheins Exp $
+# $Id: Interpolate.pm,v 2.212 2004/06/28 21:37:50 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.211 $, 10);
+$VERSION = substr(q$Revision: 2.212 $, 10);
 
 @EXPORT = qw (
 
@@ -3067,24 +3067,8 @@
 				 }
 				 return $_[0] !~ $re;
 				},
-   'length' => sub { 
-   				 my ($string, $lenspec) = @_;
-				 my ($min,$max) = split /-/, $lenspec;
-				 if($min and length($string) < $min) {
-				 	return 0;
-				 }
-				 elsif($max and length($string) > $max) {
-				 	return 0;
-				 }
-				 else {
-				 	return 0 unless length($string) > 0;
-				 }
-				 return 1;
-				},
 );
 
-$cond_op{len} = $cond_op{length};
-
 sub pull_cond {
 	my($string, $reverse, $cond, $lhs) = @_;
 #::logDebug("pull_cond string='$string' rev='$reverse' cond='$cond' lhs='$lhs'");
@@ -4972,16 +4956,10 @@
 			return;
 		}
 		my ($ary, $fh, $fa) = @$list;
-		my $obj = $opt->{object} ||= {};
-		$obj->{mv_results} = $ary;
-		$obj->{matches} = scalar @$ary;
-		$obj->{mv_field_names} = $fa if $fa;
-		$obj->{mv_field_hash} = $fh if $fh;
-		if($opt->{ml}) {
-			$obj->{mv_matchlimit} = $opt->{ml};
-			$obj->{mv_first_match} = $opt->{mv_first_match} || 0;
-			$obj->{mv_next_pointer} = $opt->{mv_first_match} + $opt->{ml};
-		}
+		$opt->{object}{mv_results} = $ary;
+		$opt->{object}{matches} = scalar @$ary;
+		$opt->{object}{mv_field_names} = $fa if $fa;
+		$opt->{object}{mv_field_hash} = $fh if $fh;
 		return region($opt, $text);
 	}
 








More information about the interchange-cvs mailing list