|
From: <var...@us...> - 2021-06-22 13:21:56
|
Revision: 10313
http://sourceforge.net/p/phpwiki/code/10313
Author: vargenau
Date: 2021-06-22 13:21:55 +0000 (Tue, 22 Jun 2021)
Log Message:
-----------
lib/plugin/TeX2png.php: Check if the needed binaries are available
Modified Paths:
--------------
trunk/lib/plugin/TeX2png.php
Modified: trunk/lib/plugin/TeX2png.php
===================================================================
--- trunk/lib/plugin/TeX2png.php 2021-06-22 09:09:11 UTC (rev 10312)
+++ trunk/lib/plugin/TeX2png.php 2021-06-22 13:21:55 UTC (rev 10313)
@@ -221,6 +221,23 @@
*/
function run($dbi, $argstr, &$request, $basepage)
{
+ // Check if the needed binaries are available
+ if (!file_exists($this->latexbin)) {
+ return HTML::span(array('class' => 'error'),
+ fmt("Cannot run %1s plugin, “%2s” does not exist",
+ "TeX2png", $this->latexbin));
+ }
+ if (!file_exists($this->dvipsbin)) {
+ return HTML::span(array('class' => 'error'),
+ fmt("Cannot run %1s plugin, “%2s” does not exist",
+ "TeX2png", $this->dvipsbin));
+ }
+ if (!file_exists($this->pstoimgbin)) {
+ return HTML::span(array('class' => 'error'),
+ fmt("Cannot run %1s plugin, “%2s” does not exist",
+ "TeX2png", $this->pstoimgbin));
+ }
+
// if imagepath does not exist, try to create it
if (!file_exists($this->imagepath)) {
if (mkdir($this->imagepath, 0777, true) === false) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|