From: skodak Date: Tue, 12 Dec 2006 12:27:59 +0000 (+0000) Subject: MDL-7901 allow empty spans in multilang block X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bbb5ac9ae66fd359b6b633fc20ee5921bc0ad404;p=moodle.git MDL-7901 allow empty spans in multilang block --- diff --git a/filter/multilang/filter.php b/filter/multilang/filter.php index 3fc0b68801..22bd3c4994 100644 --- a/filter/multilang/filter.php +++ b/filter/multilang/filter.php @@ -44,10 +44,10 @@ function multilang_filter($courseid, $text) { if (empty($CFG->filter_multilang_force_old) and !empty($CFG->filter_multilang_converted)) { // new syntax - $search = '/(.+?<\/span>)(\s*.+?<\/span>)+/is'; + $search = '/(.*?<\/span>)(\s*.*?<\/span>)+/is'; } else { // old syntax - $search = '/(<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.+?<\/(?:lang|span)>)(\s*<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.+?<\/(?:lang|span)>)+/is'; + $search = '/(<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.*?<\/(?:lang|span)>)(\s*<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.*?<\/(?:lang|span)>)+/is'; } return preg_replace_callback($search, 'multilang_filter_impl', $text); } @@ -69,10 +69,10 @@ function multilang_filter_impl($langblock) { if (empty($CFG->filter_multilang_force_old) and !empty($CFG->filter_multilang_converted)) { // new syntax - $searchtosplit = '/(.+?)<\/span>/is'; + $searchtosplit = '/(.*?)<\/span>/is'; } else { // old syntax - $searchtosplit = '/<(?:lang|span) lang="([a-zA-Z0-9_-]*)".*?>(.+?)<\/(?:lang|span)>/is'; + $searchtosplit = '/<(?:lang|span) lang="([a-zA-Z0-9_-]*)".*?>(.*?)<\/(?:lang|span)>/is'; } preg_match_all($searchtosplit, $langblock[0], $rawlanglist);