MDL-10092:

Decode HTML entities before processing.
This commit is contained in:
thepurpleblob 2007-09-11 13:53:24 +00:00
parent 12b7c16ffc
commit 1c632b934d
3 changed files with 5 additions and 2 deletions

View file

@ -1,4 +1,4 @@
<?php <?php // $Id$
// latex.php // latex.php
// render TeX stuff using latex - this will not work on all platforms // render TeX stuff using latex - this will not work on all platforms
// or configurations. Only works on Linux and Mac with appropriate // or configurations. Only works on Linux and Mac with appropriate

View file

@ -56,7 +56,8 @@
$latex = new latex(); $latex = new latex();
$density = $CFG->filter_tex_density; $density = $CFG->filter_tex_density;
$background = $CFG->filter_tex_latexbackground; $background = $CFG->filter_tex_latexbackground;
$latex_path = $latex->render( $texcache->rawtext, $md5, 12, $density, $background ); $texexp = html_entity_decode( $texcache->rawtext );
$latex_path = $latex->render( $texexp, $md5, 12, $density, $background );
if ($latex_path) { if ($latex_path) {
copy( $latex_path, $pathname ); copy( $latex_path, $pathname );
$latex->clean_up( $md5 ); $latex->clean_up( $md5 );

View file

@ -254,6 +254,8 @@
$gif = "$latex->temp_dir/$md5.gif"; $gif = "$latex->temp_dir/$md5.gif";
// put the expression as a file into the temp area // put the expression as a file into the temp area
$expression = html_entity_decode( $expression );
$output .= "<p>Processing TeX expression:</p><pre>$expression</pre>\n";
$doc = $latex->construct_latex_document( $expression ); $doc = $latex->construct_latex_document( $expression );
$fh = fopen( $tex, 'w' ); $fh = fopen( $tex, 'w' );
fputs( $fh, $doc ); fputs( $fh, $doc );