http://cvs.moodle.org/moodle/filter/tex/texed.php?r1=1.8&r2=1.7
This fixes a security problem only triggered with register_globals ON and magic_quotes_gpc OFF which is a very uncommon case
$texexp = str_replace('<','<',$texexp);
$texexp = str_replace('>','>',$texexp);
$texexp = preg_replace('!\r\n?!',' ',$texexp);
+ $pathname = "$CFG->dataroot/filter/tex/$image";
$cmd = tex_filter_get_cmd($pathname, $texexp);
system($cmd, $status);
if (file_exists($pathname)) {
+ require_once($CFG->libdir . '/filelib.php');
send_file($pathname, $image);
} else {
echo "Image not found!";