Index: trunk/extensions/SemanticGlossary/SemanticGlossaryElement.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | $this -> mFullDefinition = $doc -> createElement( 'span' ); |
52 | 52 | |
53 | 53 | foreach ( $this -> mDefinitions as $definition ) { |
54 | | - $element = $doc -> createElement( 'span', $definition[ self::SG_DEFINITION ] . ' ' ); |
| 54 | + $element = $doc -> createElement( 'span', html_entity_decode( $definition[ self::SG_DEFINITION ], ENT_COMPAT, 'UTF-8' ) . ' ' ); |
55 | 55 | if ( $definition[ self::SG_LINK ] ) { |
56 | 56 | $link = $this -> getLinkTemplate( $doc ); |
57 | 57 | $link -> setAttribute( 'href', Title::newFromText( $definition[ self::SG_LINK ] ) -> getFullURL() ); |
Index: trunk/extensions/SemanticGlossary/COPYING |
— | — | @@ -3,8 +3,8 @@ |
4 | 4 | or "COPYING", or a subdirectory thereof. For those files, the license text |
5 | 5 | contained in said file overrides any license information contained in |
6 | 6 | directories of smaller depth. Alternative licenses are typically used for |
7 | | -software that is provided by external parties, and merely packaged with the |
8 | | -Semantic Lingo release for convenience. |
| 7 | +software that is provided by external parties, and merely packaged with this |
| 8 | +software for convenience. |
9 | 9 | |
10 | 10 | ---- |
11 | 11 | |
Index: trunk/extensions/SemanticGlossary/SemanticGlossaryParser.php |
— | — | @@ -139,13 +139,11 @@ |
140 | 140 | //Get the minimum length abbreviation so we don't bother checking against words shorter than that |
141 | 141 | $min = min( array_map( 'strlen', array_keys( $terms ) ) ); |
142 | 142 | |
143 | | -// var_export($text); |
144 | 143 | //Parse HTML from page |
145 | | -// $doc = new DOMDocument(); |
146 | | -// @$doc -> loadHTML( '<html><meta http-equiv="content-type" content="charset=utf-8"/>' . $text . '</html>' ); |
147 | | -// $doc -> loadHTML( $text ); |
148 | 144 | // FIXME: this works in PHP 5.3.3. What about 5.1? |
149 | | - $doc = @DOMDocument::loadHTML( $text ); |
| 145 | + wfSuppressWarnings(); |
| 146 | + $doc = DOMDocument::loadHTML( '<html><meta http-equiv="content-type" content="charset=utf-8"/>' . $text . '</html>' ); |
| 147 | + wfRestoreWarnings(); |
150 | 148 | |
151 | 149 | //Find all text in HTML. |
152 | 150 | $xpath = new DOMXpath( $doc ); |
— | — | @@ -182,11 +180,11 @@ |
183 | 181 | $afterMatchNode = $doc -> createTextNode( substr( $el -> nodeValue, $offset[ 1 ] + strlen( $offset[ 0 ] ), strlen( $el -> nodeValue ) - 1 ) ); |
184 | 182 | |
185 | 183 | //Wrap abbreviation in <span> tags |
186 | | - $span = @$doc -> createElement( 'span' ); |
| 184 | + $span = $doc -> createElement( 'span' ); |
187 | 185 | $span -> setAttribute( 'class', "tooltip" ); |
188 | 186 | |
189 | 187 | //Wrap abbreviation in <span> tags, hidden |
190 | | - $spanAbr = @$doc -> createElement( 'span', $offset[ 0 ] ); |
| 188 | + $spanAbr = $doc -> createElement( 'span', $offset[ 0 ] ); |
191 | 189 | $spanAbr -> setAttribute( 'class', "tooltip_abbr" ); |
192 | 190 | |
193 | 191 | //Wrap definition in <span> tags, hidden |