From b47f2f004cdc421401bce9389841de6acd8549d3 Mon Sep 17 00:00:00 2001 From: "Moritz Schubotz (physikerwelt)" Date: Sun, 22 Oct 2023 07:41:56 +0200 Subject: [PATCH] Remove utf8 encode / decode For old mysql versions utf8 encode decode was required to avoid that math characters get messed up. This problem does not occur with MariaDB 10.2. As now data is stored and retrieved as binary by default, the data is returned in the same way as it is written. Bug: T324173 Change-Id: Id29c9a8614156ff8170bc3148f2498b32c70fd8a (cherry picked from commit 804c026a61719a329b993c705e3c37b058c78a1d) --- src/MathRenderer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MathRenderer.php b/src/MathRenderer.php index 2a3ec963c..da97ddc82 100644 --- a/src/MathRenderer.php +++ b/src/MathRenderer.php @@ -266,7 +266,7 @@ abstract class MathRenderer { $this->inputHash = $rpage->math_inputhash; // MUST NOT BE NULL $this->md5 = self::dbHash2md5( $this->inputHash ); if ( !empty( $rpage->math_mathml ) ) { - $this->mathml = utf8_decode( $rpage->math_mathml ); + $this->mathml = $rpage->math_mathml; } if ( !empty( $rpage->math_inputtex ) ) { // in the current database the field is probably not set. @@ -345,7 +345,7 @@ abstract class MathRenderer { protected function dbOutArray() { $out = [ 'math_inputhash' => $this->getInputHash(), - 'math_mathml' => utf8_encode( $this->mathml ), + 'math_mathml' => $this->mathml, 'math_inputtex' => $this->userInputTex, 'math_tex' => $this->tex, 'math_svg' => $this->svg