]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 327914: Make Bugzilla::Util::perform_substs() go away - Patch by Frédéric Bucli...
authorlpsolit%gmail.com <>
Fri, 20 Jul 2007 17:15:54 +0000 (17:15 +0000)
committerlpsolit%gmail.com <>
Fri, 20 Jul 2007 17:15:54 +0000 (17:15 +0000)
Bugzilla/Util.pm
showdependencygraph.cgi

index e97bb11d0cb2f17983cd55c7b8ecfadcaaf4d542..c6560dd11696f9a3630095bcad788624478e3f26 100644 (file)
@@ -39,7 +39,6 @@ use base qw(Exporter);
                              lsearch
                              diff_arrays diff_strings
                              trim wrap_comment find_wrap_point
-                             perform_substs
                              format_time format_time_decimal validate_date
                              file_mod_time is_7bit_clean
                              bz_crypt generate_random_password
@@ -355,12 +354,6 @@ sub find_wrap_point {
     return $wrappoint;
 }
 
-sub perform_substs {
-    my ($str, $substs) = (@_);
-    $str =~ s/%([a-z]*)%/(defined $substs->{$1} ? $substs->{$1} : Bugzilla->params->{$1})/eg;
-    return $str;
-}
-
 sub format_time {
     my ($date, $format) = @_;
 
@@ -566,7 +559,6 @@ Bugzilla::Util - Generic utility functions for bugzilla
   $val = trim(" abc ");
   ($removed, $added) = diff_strings($old, $new);
   $wrapped = wrap_comment($comment);
-  $msg = perform_substs($str, $substs);
 
   # Functions for formatting time
   format_time($time);
@@ -768,24 +760,6 @@ Search for a comma, a whitespace or a hyphen to split $string, within the first
 $maxpos characters. If none of them is found, just split $string at $maxpos.
 The search starts at $maxpos and goes back to the beginning of the string.
 
-=item C<perform_substs($str, $substs)>
-
-Performs substitutions for sending out email with variables in it,
-or for inserting a parameter into some other string.
-
-Takes a string and a reference to a hash containing substitution 
-variables and their values.
-
-If the hash is not specified, or if we need to substitute something
-that's not in the hash, then we will use parameters to do the 
-substitution instead.
-
-Substitutions are always enclosed with '%' symbols. So they look like:
-%some_variable_name%. If "some_variable_name" is a key in the hash, then
-its value will be placed into the string. If it's not a key in the hash,
-then the value of the parameter called "some_variable_name" will be placed
-into the string.
-
 =item C<is_7bit_clean($str)>
 
 Returns true is the string contains only 7-bit characters (ASCII 32 through 126,
index 9851a218ce0bc48e5c7a3f723240b6b456ecbf94..4842f484da950d1cb689c7d31fe65a1587dd1d80 100755 (executable)
@@ -244,8 +244,10 @@ chmod 0777, $filename;
 my $webdotbase = Bugzilla->params->{'webdotbase'};
 
 if ($webdotbase =~ /^https?:/) {
-     # Remote dot server
-     my $url = perform_substs($webdotbase) . $filename;
+     # Remote dot server. We don't hardcode 'urlbase' here in case
+     # 'sslbase' is in use.
+     $webdotbase =~ s/%([a-z]*)%/Bugzilla->params->{$1}/g;
+     my $url = $webdotbase . $filename;
      $vars->{'image_url'} = $url . ".gif";
      $vars->{'map_url'} = $url . ".map";
 } else {