MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Patch for mv_min_string



******    message to minivend-users from mikeh@minivend.com     ******

In minivend/patched at site.

diff -xRCS -I # Copyright\|$Id:\|__MVC_\|^ *$VERSION *=\|^[ 	]*$[A-z_:]*VendRoot\|^ *(#define\|my  *$)LINK_FILE\|^#!/ -c -r /home/reference/minivend-3.14/lib/Vend/Search.pm /r/Search.pm
*** /home/reference/minivend-3.14/lib/Vend/Search.pm	Mon Jun  7 04:10:14 1999
--- /r/Search.pm	Sat Jun 12 03:21:42 1999
***************
*** 217,222 ****
--- 217,247 ----
  	if ::debug(0x10 );
  # END DEBUG
  
+ 	if(! scalar @specs or ! $g->{coordinate}) {
+ 		my $found;
+ 		my $msg;
+ 		for (@specs) {
+ 			$passed = 1;
+ 		    next if length($_) >= $g->{min_string};
+ 			$msg = <<EOF;
+ Search strings must be at least $g->{min_string} characters.
+ You had '$_' as one of your search strings.
+ EOF
+ 			undef $passed;
+ 			last;
+ 		}
+ 		$passed = 1 if ! $g->{min_string};
+ 		if(! defined $passed) {
+ 			$msg = <<EOF if ! $msg;
+ Search strings must be at least $g->{min_string} characters.
+ You had no search string specified.
+ EOF
+ 			&{$g->{error_routine}}($g->{error_page}, $msg);
+ 			$g->{matches} = -1;
+ 			return undef;
+ 		}
+ 	}
+ 
  	# untaint
  	for(@specs) {
  		/(.*)/s;
diff -xRCS -I # Copyright\|$Id:\|__MVC_\|^ *$VERSION *=\|^[ 	]*$[A-z_:]*VendRoot\|^ *(#define\|my  *$)LINK_FILE\|^#!/ -c -r /home/reference/minivend-3.14/lib/Vend/TextSearch.pm /r/TextSearch.pm
*** /home/reference/minivend-3.14/lib/Vend/TextSearch.pm	Mon Jun  7 04:07:56 1999
--- /r/TextSearch.pm	Sat Jun 12 03:29:59 1999
***************
*** 147,152 ****
--- 147,154 ----
  	@specs = '' if @specs == 0;
  
  	@pats = $s->spec_check($g, @specs);
+ 
+ 	return undef if $g->{matches} == -1;
  
  # DEBUG
  Vend::Util::logDebug

-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: