/** * Check latex cgi script * * @param string latex cgi url * @return boolean true -> OK | false -> not OK */ function testLatex($a_latex_url) { // latex is optional, so empty path is ok if (trim($a_latex_url) == "") { return ""; } // open the URL include_once "./setup/classes/class.ilHttpRequest.php"; $http = new ilHttpRequest(ilUtil::stripSlashes($a_latex_url) . "?x_0"); $result = @$http->downloadToString(); if (strpos(substr($result, 0, 5), "PNG") !== FALSE || strpos(substr($result, 0, 5), "GIF") !== FALSE) { return ""; } else { return "check_failed_latex"; } }