]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10092:
authorthepurpleblob <thepurpleblob>
Tue, 11 Sep 2007 13:55:33 +0000 (13:55 +0000)
committerthepurpleblob <thepurpleblob>
Tue, 11 Sep 2007 13:55:33 +0000 (13:55 +0000)
Decode HTML entities before processing.

Merged from STABLE_18

filter/tex/latex.php
filter/tex/pix.php
filter/tex/texdebug.php

index d00c94b3a10ee26d31a09eeff9e846b43cfe558e..b476683bda50c526571ef9f74e331cab5d07b452 100644 (file)
@@ -1,4 +1,4 @@
-<?php
+<?php // $Id$
     // latex.php
     // render TeX stuff using latex - this will not work on all platforms
     // or configurations. Only works on Linux and Mac with appropriate 
index 66d39c67516622ddca64ea3f74b2270038196887..64bb46c2e3ee7764d9ea220cdfefedff30c259c4 100644 (file)
@@ -56,7 +56,8 @@
             $latex = new latex();
             $density = $CFG->filter_tex_density;
             $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) {    
                 copy( $latex_path, $pathname );
                 $latex->clean_up( $md5 );
index e4224ecd31e7a4432874c11b6962c302b5c263b8..3b2ad1e21b3dad6d0da114cc42c90a5957fc08ef 100644 (file)
         $gif = "$latex->temp_dir/$md5.gif";
 
         // 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 );
         $fh = fopen( $tex, 'w' );
         fputs( $fh, $doc );