Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
9f4501f4
Commit
9f4501f4
authored
Feb 04, 2005
by
travis%sedsystems.ca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 277623 : Move PerformSubsts() out of globals.pl
Patch by Max Kanat-Alexander <mkanat@kerio.com> r=vladd a=justdave
parent
5a017c4d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
BugMail.pm
Bugzilla/BugMail.pm
+26
-0
globals.pl
globals.pl
+0
-7
showdependencygraph.cgi
showdependencygraph.cgi
+1
-0
No files found.
Bugzilla/BugMail.pm
View file @
9f4501f4
...
...
@@ -30,6 +30,11 @@ use strict;
package
Bugzilla::
BugMail
;
use
base
qw(Exporter)
;
@
Bugzilla::BugMail::
EXPORT
=
qw(
PerformSubsts
)
;
use
Bugzilla::
RelationSet
;
use
Bugzilla::
Config
qw(:DEFAULT $datadir)
;
...
...
@@ -903,4 +908,25 @@ sub MessageToMTA ($) {
$mailer
->
close
;
}
# 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.
sub
PerformSubsts
($;$) {
my
(
$str
,
$substs
)
=
(
@_
);
$str
=~
s/%([a-z]*)%/(defined $substs->{$1} ? $substs->{$1} : Param($1))/eg
;
return
$str
;
}
1
;
globals.pl
View file @
9f4501f4
...
...
@@ -1276,13 +1276,6 @@ sub RemoveVotes {
}
}
sub
PerformSubsts
{
my
(
$str
,
$substs
)
=
(
@_
);
$str
=~
s/%([a-z]*)%/(defined $substs->{$1} ? $substs->{$1} : Param($1))/eg
;
return
$str
;
}
###############################################################################
# Constructs a format object from URL parameters. You most commonly call it
...
...
showdependencygraph.cgi
View file @
9f4501f4
...
...
@@ -29,6 +29,7 @@ use File::Temp;
use
Bugzilla
;
use
Bugzilla::
Config
qw(:DEFAULT $webdotdir)
;
use
Bugzilla::
Util
;
use
Bugzilla::
BugMail
;
require
"CGI.pl"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment