r88907 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88906‎ | r88907 | r88908 >
Date:17:45, 26 May 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
bugfixes: do not markup links, use new doc fragment on each MW parser run
Modified paths:
  • /trunk/extensions/SemanticGlossary/SemanticGlossaryElement.php (modified) (history)
  • /trunk/extensions/SemanticGlossary/SemanticGlossaryParser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticGlossary/SemanticGlossaryElement.php
@@ -85,9 +85,8 @@
8686
8787 private function getLinkTemplate ( DOMDocument &$doc ) {
8888
89 - // create template if it doesnot yet exist
90 - // FIXME: Is it safe to use a singleton here?
91 - if ( !self::$mLinkTemplate ) {
 89+ // create template if it does not yet exist
 90+ if ( !self::$mLinkTemplate || ( self::$mLinkTemplate -> ownerDocument !== $doc ) ) {
9291
9392 global $wgScriptPath;
9493
Index: trunk/extensions/SemanticGlossary/SemanticGlossaryParser.php
@@ -152,7 +152,7 @@
153153
154154 //Find all text in HTML.
155155 $xpath = new DOMXpath( $doc );
156 - $elements = $xpath -> query( "//*[not(ancestor::*[@class='noglossary'])][text()!=' ']/text()" );
 156+ $elements = $xpath -> query( "//*[not(ancestor-or-self::*[@class='noglossary'] or ancestor-or-self::a)][text()!=' ']/text()" );
157157
158158 //Iterate all HTML text matches
159159 $nb = $elements -> length;

Status & tagging log