r17086 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17085‎ | r17086 | r17087 >
Date:12:30, 18 October 2006
Author:proes
Status:old
Tags:
Comment:
Again improved truncation of longer defined meaning definitions: border case is also handled correctly now.
Modified paths:
  • /trunk/extensions/Wikidata/WiktionaryZ/Editor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/WiktionaryZ/Editor.php
@@ -739,7 +739,7 @@
740740 $definedMeaningAsLink = definedMeaningAsLink($value);
741741 $escapedDefinition = htmlspecialchars($definition);
742742
743 - if ($this->truncate && strlen($definition) >= $this->truncateAt)
 743+ if ($this->truncate && strlen($definition) > $this->truncateAt)
744744 $escapedDefinition = '<span title="'. $escapedDefinition .'">'. htmlspecialchars(substr($definition, 0, $this->truncateAt)) . '...</span>';
745745
746746 return $definedMeaningAsLink . ": " . $escapedDefinition;
@@ -786,7 +786,7 @@
787787 // global $wgParser, $wgTitle, $wgOut;
788788 // $parserOutput = $wgParser->parse($value, $wgTitle, $wgOut->mParserOptions, true, true, $wgOut->mRevisionId);
789789
790 - if (!$this->truncate || strlen($value) < $this->truncateAt)
 790+ if (!$this->truncate || strlen($value) <= $this->truncateAt)
791791 return $escapedValue;//$parserOutput->getText();
792792 else
793793 return '<span title="'. $escapedValue .'">'. htmlspecialchars(substr($value, 0, $this->truncateAt)) . '...</span>';