[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] patches against mv-3.14-4
To any one interested, here are a couple of patches for
Scan.pm & Interpolate.pm; they correct problems found in
the source code, I tought I would share it with you guys.
The Scan.pm-patch corrects Searches using OR/AND keywords.
The Interpolate.pm-patch improves the "ImageDir" replacement
in <IMG> tag and adds <BACKGROUND> to that processing.
Let me know if you find any problem (or additions) to these.
Regards,
--
marc
Suicide Hotline...please hold.
--- Interpolate.pm.dist Tue Jan 25 17:30:11 2000
+++ Interpolate.pm Wed Jan 26 11:42:17 2000
@@ -292,12 +292,16 @@
$Vend::Cfg->{ImageDir};
if ($dir) {
- $$text =~ s#(<i\w+\s+[^>]*?src=")(?!https?:)([^/][^"]+)#
+ $$text =~ s#(background\s*?[^>]*?=\s*?")(?!https?:)([^/][^"]+)#
+ $1 . $dir . $2#ige;
+ $$text =~ s#(<i\w+\s+[^>]*?src\s*?=\s*?")(?!https?:)([^/][^"]+)#
$1 . $dir . $2#ige;
}
if($Vend::Cfg->{ImageAlias}) {
for (keys %{$Vend::Cfg->{ImageAlias}} ) {
- $$text =~ s#(<i\w+\s+[^>]*?src=")($_)#
+ $$text =~ s#(background\s*?[^>]*?=\s*?")($_)#
+ $1 . ($Vend::Cfg->{ImageAlias}->{$2} || $2)#ige;
+ $$text =~ s#(<i\w+\s+[^>]*?src\s*?=\s*?")($_)#
$1 . ($Vend::Cfg->{ImageAlias}->{$2} || $2)#ige;
}
}
@@ -749,7 +753,7 @@
$html =~ s#$T{'process-target'}$Opt$Opt$T#
tag_process_target($1,$2)#goe;
- $html =~ s#(<i\w+\s+[^>]*?src=")(?!http:)([^/][^"]+)#
+ $html =~ s#(<i\w+\s+[^>]*?src\s*?=\s*?")(?!http:)([^/][^"]+)#
$1 . $Vend::Cfg->{ImageDir} . $2#ige
if $Vend::Cfg->{ImageDir};
@@ -4725,7 +4729,7 @@
&& ${$Vend::Cfg->{Color}->{$var}}[$scheme] !~ /\bnone\b/;
}
}
- $r =~ s#(BACKGROUND="(?!http:))([^/])#$1$Vend::Cfg->{ImageDir}$2#;
+ $r =~ s#(BACKGROUND="(?!http:))([^/])#$1$Vend::Cfg->{ImageDir}$2#i;
$r .= " $extra" if defined $extra;
$r .= '>';
}
--- Scan.pm.dist Tue Jan 25 17:25:12 2000
+++ Scan.pm Tue Jan 25 17:27:17 2000
@@ -1218,7 +1218,7 @@
}
sub _yes {
- return( defined($_[1]) && ($_[1] =~ /^[yYtT1]/));
+ return( defined($_[0]) && ($_[0] =~ /^[yYtT1]/));
}
sub _number {
@@ -1272,7 +1272,7 @@
unshift(@fields, ref $_[2] ? @{$_[2]} : $_[2]);
}
#::logGlobal("fields=", @fields);
- map { $_ = _yes('',$_) } @fields;
+ map { $_ = _yes($_) } @fields;
return \@fields if @fields > 1;
return $fields[0];
}