From e5bd65c96612a6e46bfb6bee11416599f7c69f3b Mon Sep 17 00:00:00 2001 From: vargenau Date: Fri, 3 Oct 2014 14:54:29 +0000 Subject: [PATCH] function ImageTypes exists git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@9179 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/WikiPluginCached.php | 14 ++++---------- lib/plugin/TeX2png.php | 4 +--- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/lib/WikiPluginCached.php b/lib/WikiPluginCached.php index 24eb3b021..7ae2eedb3 100644 --- a/lib/WikiPluginCached.php +++ b/lib/WikiPluginCached.php @@ -539,16 +539,10 @@ class WikiPluginCached extends WikiPlugin 'xbm' => IMG_XBM, */ ); - if (function_exists('ImageTypes')) { - $presenttypes = ImageTypes(); - foreach ($imagetypes as $imgtype => $bitmask) - if ($presenttypes && $bitmask) - array_push($supportedtypes, $imgtype); - } else { - foreach ($imagetypes as $imgtype => $bitmask) - if (function_exists("Image" . $imgtype)) - array_push($supportedtypes, $imgtype); - } + $presenttypes = ImageTypes(); + foreach ($imagetypes as $imgtype => $bitmask) + if ($presenttypes && $bitmask) + array_push($supportedtypes, $imgtype); if (in_array($wish, $supportedtypes)) return $wish; elseif (!empty($supportedtypes)) diff --git a/lib/plugin/TeX2png.php b/lib/plugin/TeX2png.php index ebcf444d5..96493a69b 100644 --- a/lib/plugin/TeX2png.php +++ b/lib/plugin/TeX2png.php @@ -221,9 +221,7 @@ class WikiPlugin_TeX2png function run($dbi, $argstr, &$request, $basepage) { // from text2png.php - if ((function_exists('ImageTypes') and (ImageTypes() & IMG_PNG)) - or function_exists("ImagePNG") - ) { + if (ImageTypes() & IMG_PNG) { // we have gd & png so go ahead. extract($this->getArgs($argstr, $request)); return $this->tex2png($text); -- 2.45.0