From 54d0812500fac303dcaac04107ac5d752a0a5f0c Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 25 Dec 2007 11:42:45 +0000 Subject: [PATCH] MDL-11561 tex debug leaking sensitive info; merged from MOODLE_19_STABLE --- filter/tex/texdebug.php | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/filter/tex/texdebug.php b/filter/tex/texdebug.php index b4426df9fe..fdb2d839e7 100644 --- a/filter/tex/texdebug.php +++ b/filter/tex/texdebug.php @@ -82,7 +82,11 @@ // Action: Show Tex command line output if ($action=='ShowOutputTex') { - TexOutput($texexp); + if (debugging()) { + TexOutput($texexp); + } else { + echo "Can not output detailed information due to security concerns, please turn on debug mode first."; + } exit; } @@ -140,7 +144,7 @@ if (file_exists($pathname)) { send_file($pathname, $image); - } else { + } else if (debugging()) { $ecmd = "$cmd 2>&1"; echo `$ecmd` . "
\n"; echo "The shell command
$cmd
returned status = $status
\n"; @@ -166,6 +170,8 @@ echo "mimetex executable $commandpath not found!
"; } echo "Image not found!"; + } else { + echo "Can not output detailed information due to security concerns, please turn on debug mode first."; } } @@ -284,18 +290,18 @@

The following tests are available:

    -
  1. - See the cache_filters database entry for this expression (if any).
  2. -
  3. - Delete the cache_filters database entry for this expression (if any).
  4. -
  5. - Show a graphic image of the algebraic expression rendered with mimetex.
  6. -
  7. - Show a graphic image of the algebraic expression rendered with Tex/Ghostscript.
  8. -
  9. - Show command execution output from the algebraic expression rendered with Tex/Ghostscript.
  10. -
  11. - Check slasharguments setting.
  12. +
  13. +
  14. +
  15. +
  16. +
  17. +
  18. +
  19. +
  20. +
  21. +
  22. +
  23. +


-- 2.39.5