Physikerwelt has submitted this change and it was merged.
Change subject: Do proper pre-pack processing for $this->hash.
......................................................................
Do proper pre-pack processing for $this->hash.
Output hash calcuation sometimes fails because of Texvc failure for
example, and $this->hash remains ''. At this time inserting null as
outputhash into database is improper, because that column is NOT NULL.
With this patch an empty string '' is inserted instead, and the if-check
is modified to avoid cases where ->hash exists but evaluates as null
(for example when it's '0000000000...' though it's extremely rare).
Change-Id: I852859f4b151b777c11b743faaed61dfc2c029a7
---
M MathRenderer.php
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Physikerwelt: Verified; Looks good to me, approved
jenkins-bot: Checked
diff --git a/MathRenderer.php b/MathRenderer.php
index 10676aa..e969ad9 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -154,10 +154,10 @@
# Now save it back to the DB:
if ( !wfReadOnly() ) {
$dbw = wfGetDB( DB_MASTER );
- if ( $this->hash ) {
+ if ( $this->hash !== '' ) {
$outmd5_sql = $dbw->encodeBlob( pack( 'H32',
$this->hash ) );
} else {
- $outmd5_sql = null;
+ $outmd5_sql = '';
}
wfDebugLog( "Math", 'store entry for $' . $this->tex .
'$ in database (hash:' . $this->getInputHash() . ')\n' );
$dbw->replace(
--
To view, visit https://gerrit.wikimedia.org/r/53556
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I852859f4b151b777c11b743faaed61dfc2c029a7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Liangent <[email protected]>
Gerrit-Reviewer: Liangent <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Physikerwelt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits