Physikerwelt has submitted this change and it was merged.

Change subject: Failsave method for highlighting
......................................................................


Failsave method for highlighting

Change-Id: I430a7a1b7a325b5ede5e814d370fcc3171d048f9
---
M SpecialMathSearch.php
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/SpecialMathSearch.php b/SpecialMathSearch.php
index 5431b9f..f3c0d81 100644
--- a/SpecialMathSearch.php
+++ b/SpecialMathSearch.php
@@ -144,8 +144,12 @@
                                        $dom = new DOMDocument;
                                        $dom->loadXML($mml);
                                        
$domRes=$dom->getElementById($node["xref"][0]);
-                                       $domRes->setAttribute('mathcolor', 
'#cc0000');
-                                       $out->addHtml( 
$domRes->ownerDocument->saveXML());
+                                       if ($domRes){
+                                               
$domRes->setAttribute('mathcolor', '#cc0000');
+                                               $out->addHtml( 
$domRes->ownerDocument->saveXML());
+                                       } else {
+                                               
$out->addHtml(MathLaTeXML::embedMathML($mml));
+                                       }
                                }
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I430a7a1b7a325b5ede5e814d370fcc3171d048f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[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