Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
e123b97e
Commit
e123b97e
authored
12 years ago
by
Peter Rotich
Browse files
Options
Downloads
Plain Diff
Merge pull request #386 from protich/issue/384
Issue/384
parents
0a9fe20d
8ee85cd6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/class.mailer.php
+3
-3
3 additions, 3 deletions
include/class.mailer.php
include/class.variable.php
+1
-10
1 addition, 10 deletions
include/class.variable.php
with
4 additions
and
13 deletions
include/class.mailer.php
+
3
−
3
View file @
e123b97e
...
...
@@ -92,9 +92,9 @@ class Mailer {
require_once
(
PEAR_DIR
.
'Mail/mime.php'
);
// PEAR Mail_Mime packge
//do some cleanup
$to
=
preg_replace
(
"/(
\r\n
|
\r
|
\n
)/s"
,
''
,
trim
(
$to
));
$subject
=
stripslashes
(
preg_replace
(
"/(
\r\n
|
\r
|
\n
)/s"
,
''
,
trim
(
$subject
))
)
;
$body
=
stripslashes
(
preg_replace
(
"/(
\r\n
|
\r
)/s"
,
"
\n
"
,
trim
(
$message
))
)
;
$to
=
preg_replace
(
"/(
\r\n
|
\r
|
\n
)/s"
,
''
,
trim
(
$to
));
$subject
=
preg_replace
(
"/(
\r\n
|
\r
|
\n
)/s"
,
''
,
trim
(
$subject
));
$body
=
preg_replace
(
"/(
\r\n
|
\r
)/s"
,
"
\n
"
,
trim
(
$message
));
/* Message ID - generated for each outgoing email */
$messageId
=
sprintf
(
'<%s%d-%s>'
,
Misc
::
randCode
(
6
),
time
(),
...
...
This diff is collapsed.
Click to expand it.
include/class.variable.php
+
1
−
10
View file @
e123b97e
...
...
@@ -98,7 +98,7 @@ class VariableReplacer {
if
(
!
(
$vars
=
$this
->
_parse
(
$input
)))
return
$input
;
return
preg
_replace
(
$this
->
_delimit
(
array_keys
(
$vars
)
)
,
array_values
(
$vars
),
$input
);
return
str
_replace
(
array_keys
(
$vars
),
array_values
(
$vars
),
$input
);
}
function
_resolveVar
(
$var
)
{
...
...
@@ -134,14 +134,5 @@ class VariableReplacer {
return
$vars
;
}
//Helper function - will be replaced by a lambda function (PHP 5.3+)
function
_delimit
(
$val
,
$d
=
'/'
)
{
if
(
$val
&&
is_array
(
$val
))
return
array_map
(
array
(
$this
,
'_delimit'
),
$val
);
return
$d
.
$val
.
$d
;
}
}
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment