Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
8a5961ce
Commit
8a5961ce
authored
Feb 09, 2004
by
Steven Wittens
Browse files
- Fixed possible issue with preg_replace with /e
parent
97c2aa2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/title.module
View file @
8a5961ce
...
...
@@ -79,9 +79,9 @@ function title_filter($op, $text = "") {
// filter [node title|description] links. '|description' is optional.
function
_title_filter_process
(
$text
)
{
$pattern
=
'\[([^\|\]]+)(?>\|?)(
.*?
)\]'
;
// $1 == title: matches at least 1 char up to the first '|' or ']'
$pattern
=
'\[([^\|\]
\n
]+)(?>\|?)(
[^\]\n]*
)\]'
;
// $1 == title: matches at least 1 char up to the first '|' or ']'
// $2 == text: matches all after a following '|' (if there is) up to the next ']'. may include '|'s.
$replacement
=
'l(
"$2" ? "$2" : "$1", "
title/
"
. urlencode(
"$1"
))'
;
$replacement
=
'l(
\'$2\' ? \'$2\' : \'$1\', \'
title/
\'
. urlencode(
\'$1\'
))'
;
return
preg_replace
(
"/
$pattern
/e"
,
$replacement
,
$text
);
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment