Mobrovac has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/292340

Change subject: Fix iterator in batchGetMathML
......................................................................

Fix iterator in batchGetMathML

In case there was an error with a check request the SVG size
information was not assigned to the correct SVG image.
This was due to this obvious bug in the batchGetMathML
iterator.

Bug: T136688
Change-Id: Ib2660597a6fb6ef96ba0c5c0ee0fa396b0ea3a24
---
M MathRestbaseInterface.php
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/40/292340/1

diff --git a/MathRestbaseInterface.php b/MathRestbaseInterface.php
index d2eef4f..3f42832 100644
--- a/MathRestbaseInterface.php
+++ b/MathRestbaseInterface.php
@@ -49,21 +49,20 @@
                        $i ++;
                }
                $results = $serviceClient->runMulti( $requests );
-               $i = 0;
+               $lenRbis = count( $rbis );
                $j = 0;
-               foreach ( $results as $response ) {
+               for ( $i = 0; $i < $lenRbis; $i ++ ) {
                        if ( !in_array( $i, $skips ) ) {
                                /** @var MathRestbaseInterface $rbi */
                                $rbi = $rbis[$i];
                                try {
-                                       $mml = $rbi->evaluateContentResponse( 
'mml', $response, $requests[$j] );
+                                       $mml = $rbi->evaluateContentResponse( 
'mml', $results[$j], $requests[$j] );
                                        $rbi->mml = $mml;
                                }
                                catch ( Exception $e ) {
                                }
                                $j ++;
                        }
-                       $i ++;
                }
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/292340
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2660597a6fb6ef96ba0c5c0ee0fa396b0ea3a24
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: wmf/1.28.0-wmf.4
Gerrit-Owner: Mobrovac <[email protected]>
Gerrit-Reviewer: Physikerwelt <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to