http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88994
Revision: 88994
Author: foxtrott
Date: 2011-05-27 20:40:22 +0000 (Fri, 27 May 2011)
Log Message:
-----------
bugfixes (crashes when trying to use illegal characters in a link; crashes on
message output)
Modified Paths:
--------------
trunk/extensions/SemanticGlossary/SemanticGlossaryElement.php
trunk/extensions/SemanticGlossary/SemanticGlossaryParser.php
Modified: trunk/extensions/SemanticGlossary/SemanticGlossaryElement.php
===================================================================
--- trunk/extensions/SemanticGlossary/SemanticGlossaryElement.php
2011-05-27 20:35:05 UTC (rev 88993)
+++ trunk/extensions/SemanticGlossary/SemanticGlossaryElement.php
2011-05-27 20:40:22 UTC (rev 88994)
@@ -52,9 +52,12 @@
foreach ( $this -> mDefinitions as $definition ) {
$element = $doc -> createElement( 'span',
html_entity_decode( $definition[ self::SG_DEFINITION ], ENT_COMPAT, 'UTF-8' ) .
' ' );
if ( $definition[ self::SG_LINK ] ) {
- $link = $this -> getLinkTemplate( $doc
);
- $link -> setAttribute( 'href',
Title::newFromText( $definition[ self::SG_LINK ] ) -> getFullURL() );
- $element -> appendChild( $link );
+ $linkedTitle = Title::newFromText(
$definition[ self::SG_LINK ] );
+ if ( $linkedTitle ) {
+ $link = $this ->
getLinkTemplate( $doc );
+ $link -> setAttribute( 'href',
$linkedTitle -> getFullURL() );
+ $element -> appendChild( $link
);
+ }
}
$this -> mFullDefinition -> appendChild(
$element );
}
Modified: trunk/extensions/SemanticGlossary/SemanticGlossaryParser.php
===================================================================
--- trunk/extensions/SemanticGlossary/SemanticGlossaryParser.php
2011-05-27 20:35:05 UTC (rev 88993)
+++ trunk/extensions/SemanticGlossary/SemanticGlossaryParser.php
2011-05-27 20:40:22 UTC (rev 88994)
@@ -91,7 +91,7 @@
if ( $messages ) {
$messages -> addMessage(
- wfMsg(
'semanticglossary-termdefinedtwice', array( $subject -> getPrefixedText() ) ),
+ wfMsg(
'semanticglossary-termdefinedtwice', array( $subject -> getTitle() ->
getPrefixedText() ) ),
SemanticGlossaryMessageLog::SG_WARNING );
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs