mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Fixed regular expression - Bug 2756 (SE)
This commit is contained in:
parent
de680e7097
commit
4161807b81
1 changed files with 3 additions and 3 deletions
|
@ -85,7 +85,7 @@ function filter_phrases ($text, $link_array, $ignoretagsopen=NULL, $ignoretagscl
|
||||||
|
|
||||||
/// Remove tags from $text
|
/// Remove tags from $text
|
||||||
$tags = array();
|
$tags = array();
|
||||||
preg_match_all('/<[^\#](.+?)[^\#]>/is',$text,$list_of_tags);
|
preg_match_all('/<[^\#](.*?)>/is',$text,$list_of_tags);
|
||||||
foreach (array_unique($list_of_tags[0]) as $key=>$value) {
|
foreach (array_unique($list_of_tags[0]) as $key=>$value) {
|
||||||
$tags['<|'.$key.'|>'] = $value;
|
$tags['<|'.$key.'|>'] = $value;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ function filter_phrases ($text, $link_array, $ignoretagsopen=NULL, $ignoretagscl
|
||||||
|
|
||||||
/// Time to cycle through each phrase to be linked
|
/// Time to cycle through each phrase to be linked
|
||||||
foreach ($link_array as $linkobject) {
|
foreach ($link_array as $linkobject) {
|
||||||
|
|
||||||
/// Set some defaults if certain properties are missing
|
/// Set some defaults if certain properties are missing
|
||||||
/// Properties may be missing if the filterobject class has not been used to construct the object
|
/// Properties may be missing if the filterobject class has not been used to construct the object
|
||||||
if (!isset($linkobject->phrase)) {
|
if (!isset($linkobject->phrase)) {
|
||||||
|
@ -174,7 +174,7 @@ function filter_phrases ($text, $link_array, $ignoretagsopen=NULL, $ignoretagscl
|
||||||
$newtagsarray[] = $newtags;
|
$newtagsarray[] = $newtags;
|
||||||
}
|
}
|
||||||
unset($newtags);
|
unset($newtags);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue