<?php
print "<form method=\"post\" action=\"{$wgServer}{$wgScriptPath}/texvc_cgi.phtml\">"
?>
-<textarea name='math' rows='10' cols='80'><?
+<textarea name='math' rows='10' cols='80'><?php
global $math;
$math = preg_replace ("/\\\\\\\\/", '\\', $math);
print $math;
function texvc_cgi_renderMath( $tex )
{
global $wgMathDirectory, $wgTmpDirectory, $wgInputEncoding;
- $dbr =& wfGetDB( DB_READ );
+ $dbr =& wfGetDB( DB_SLAVE );
$mf = wfMsg( "math_failure" );
$munk = wfMsg( "math_unknown_error" );
$md5_sql = pack("H32", $md5);
$mathTable = $dbr->tableName( 'math' );
- $rpage = $dbr->getArray( 'math', array('math_outputhash','math_html_conservativeness','math_html','math_mathml'),
+ $rpage = $dbr->selectRow( 'math', array('math_outputhash','math_html_conservativeness','math_html','math_mathml'),
array( 'math_inputhash' => $md5_sql ) );
if ( $rpage === false )
$outmd5_sql = pack("H32", $outmd5);
# Someone may have inserted the same hash since the SELECT, but that's no big deal, just ignore errors
- $dbw =& wfGetDB( DB_WRITE );
- $dbw->insertArray( 'math',
+ $dbw =& wfGetDB( DB_MASTER );
+ $dbw->insert( 'math',
array(
'math_inputhash' => $md5_sql,
'math_outputhash' => $outmd5_sql,
// we don't really care if it fails
} else {
- $rpage = $dbr->fetchObject ( $res );
$outmd5 = unpack ("H32md5", $rpage->math_outputhash);
$outmd5 = $outmd5 ['md5'];
$outhtml = $rpage->math_html;