aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-04 17:25:09 +0000
committerlpsolit%gmail.com <>2006-06-04 17:25:09 +0000
commit71d87fd8ebcf45363078a1e5f765ed99e47314e1 (patch)
tree3a5660bd70a0d53a918f5426ebd4040b2f78881e /Bugzilla/Util.pm
parentPatch for bug 340126: Fix Windows PPM package name for XML::Twig; patch by Vl... (diff)
downloadbugzilla-71d87fd8ebcf45363078a1e5f765ed99e47314e1.tar.gz
bugzilla-71d87fd8ebcf45363078a1e5f765ed99e47314e1.tar.bz2
bugzilla-71d87fd8ebcf45363078a1e5f765ed99e47314e1.zip
Bug 340226: Util.pm shouldn't depend on Bugzilla::Config - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=justdave
Diffstat (limited to 'Bugzilla/Util.pm')
-rw-r--r--Bugzilla/Util.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm
index 98a3065cf..c2281b535 100644
--- a/Bugzilla/Util.pm
+++ b/Bugzilla/Util.pm
@@ -44,7 +44,6 @@ use base qw(Exporter);
bz_crypt generate_random_password
validate_email_syntax clean_text);
-use Bugzilla::Config;
use Bugzilla::Constants;
use Date::Parse;
@@ -269,7 +268,7 @@ sub find_wrap_point {
sub perform_substs {
my ($str, $substs) = (@_);
- $str =~ s/%([a-z]*)%/(defined $substs->{$1} ? $substs->{$1} : Param($1))/eg;
+ $str =~ s/%([a-z]*)%/(defined $substs->{$1} ? $substs->{$1} : Bugzilla->params->{$1})/eg;
return $str;
}
@@ -295,7 +294,8 @@ sub format_time {
}
else {
# Search for %Z or %z, meaning we want the timezone to be displayed.
- # Till bug 182238 gets fixed, we assume Param('timezone') is used.
+ # Till bug 182238 gets fixed, we assume Bugzilla->params->{'timezone'}
+ # is used.
$show_timezone = ($format =~ s/\s?%Z$//i);
}
@@ -304,7 +304,7 @@ sub format_time {
if (defined $time) {
$date = time2str($format, $time);
- $date .= " " . &::Param('timezone') if $show_timezone;
+ $date .= " " . Bugzilla->params->{'timezone'} if $show_timezone;
}
else {
# Don't let invalid (time) strings to be passed to templates!
@@ -365,7 +365,7 @@ sub generate_random_password {
sub validate_email_syntax {
my ($addr) = @_;
- my $match = Param('emailregexp');
+ my $match = Bugzilla->params->{'emailregexp'};
my $ret = ($addr =~ /$match/ && $addr !~ /[\\\(\)<>&,;:"\[\] \t\r\n]/);
return $ret ? 1 : 0;
}
@@ -406,7 +406,7 @@ sub get_netaddr {
my $addr = unpack("N", pack("CCCC", split(/\./, $ipaddr)));
- my $maskbits = Param('loginnetmask');
+ my $maskbits = Bugzilla->params->{'loginnetmask'};
# Make Bugzilla ignore the IP address if loginnetmask is set to 0
return "0.0.0.0" if ($maskbits == 0);
@@ -579,9 +579,9 @@ in a command-line script.
=item C<get_netaddr($ipaddr)>
Given an IP address, this returns the associated network address, using
-C<Param('loginnetmask')> as the netmask. This can be used to obtain data
-in order to restrict weak authentication methods (such as cookies) to
-only some addresses.
+C<Bugzilla->params->{'loginnetmask'}> as the netmask. This can be used
+to obtain data in order to restrict weak authentication methods (such as
+cookies) to only some addresses.
=back