11
Er... I spoke too soon.
The editor works, but the code tag still fails.
It seems to be the codeConv function. I suspect the syntax highlighter needs something newer to work with than whatever the antique module is giving it!
If I swap the funcs (as I did in an earlier test) it works, although without the syntax highlighting.
This is the 2.4.5 function:
function codeConv($text, $xcode = 1)
{
if (empty($xcode)) {
return $text;
}
$patterns = "/[code([^]]*?)](.*)[/code]/esU";
$replacements = "'xoopsCode">'.
$this->executeExtension('syntaxhighlight', str_replace('"', '"', base64_decode('$2')), '$1').'
'";
$text = preg_replace($patterns, $replacements, $text);
return $text;
}
This is the one from 2.0.18 (works)
function codeConv($text, $xcode = 1, $image = 1){
if($xcode != 0){
$patterns = "/[code](.*)[/code]/esU";
if ($image != 0) {
// image allowed
$replacements = "'xoopsCode">'.MyTextSanitizer::codeSanitizer('$1').'
'";
//$text =& $this->xoopsCodeDecode($text);
} else {
// image not allowed
$replacements = "'xoopsCode">'.MyTextSanitizer::codeSanitizer('$1', 0).'
'";
//$text =& $this->xoopsCodeDecode($text, 0);
}
$text = preg_replace($patterns, $replacements, $text);
}
return $text;
}
Some more digging required.
A thread is for life. Not just for Christmas.