Daniel Friesen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/49380
Change subject: Fix Math for databases that use Blob classes.
......................................................................
Fix Math for databases that use Blob classes.
Some databases like sqlite use a Blob class as the output of encodeBlob
which is used by getInputHash. This results in a fatal error being thrown
when writeDBEntry constructs the wfDebug line since the Blob class cannot
be converted into a string.
Fix the issue by checking to see if the return from getInputHash is a Blob
class and if so use the blob's fetch method.
Change-Id: I3fb670aca4444f149e4bc2bd4872479b0da8e8fb
---
M MathRenderer.php
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math
refs/changes/80/49380/1
diff --git a/MathRenderer.php b/MathRenderer.php
index a0b09a9..6974ceb 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -159,7 +159,12 @@
} else {
$outmd5_sql = null;
}
- wfDebugLog( "Math", 'store entry for $' . $this->tex .
'$ in database (hash:' . $this->getInputHash() . ')\n' );
+ # Some Databases use the Blob type which doesnt turn
into a string.
+ $hash = $this->getInputHash();
+ if ( $hash instanceof Blob ) {
+ $hash = $hash->fetch();
+ }
+ wfDebugLog( "Math", 'store entry for $' . $this->tex .
'$ in database (hash:' . $hash . ')\n' );
$dbw->replace(
'math',
array( 'math_inputhash' ),
--
To view, visit https://gerrit.wikimedia.org/r/49380
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fb670aca4444f149e4bc2bd4872479b0da8e8fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Daniel Friesen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits