Index: trunk/extensions/DataTransclusion/DataTransclusionHandler.php |
— | — | @@ -296,7 +296,7 @@ |
297 | 297 | '!\]!' => ']', |
298 | 298 | '!\{!' => '{', |
299 | 299 | '!\}!' => '}', |
300 | | - '!\'!' => ''', |
| 300 | + '!\'!' => ''', //NOTE: ' doesn't work, mediawiki escapes it. maybe because it'S not in HTML 4. |
301 | 301 | '!\|!' => '|', |
302 | 302 | '!^\*!m' => '*', |
303 | 303 | '!^#!m' => '#', |
Index: trunk/extensions/DataTransclusion/tests/DataTransclusionTest.php |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | $this->assertEquals( DataTransclusionHandler::sanitizeValue( 'foo <bar>' ), 'foo <bar>' ); |
95 | 95 | $this->assertEquals( DataTransclusionHandler::sanitizeValue( 'foo [[bar]]' ), 'foo [[bar]]' ); |
96 | 96 | $this->assertEquals( DataTransclusionHandler::sanitizeValue( 'foo {{bar}}' ), 'foo {{bar}}' ); |
97 | | - $this->assertEquals( DataTransclusionHandler::sanitizeValue( 'foo \'bar\'' ), 'foo 'bar'' ); |
| 97 | + $this->assertEquals( DataTransclusionHandler::sanitizeValue( 'foo \'bar\'' ), 'foo 'bar'' ); |
98 | 98 | $this->assertEquals( DataTransclusionHandler::sanitizeValue( 'foo|bar' ), 'foo|bar' ); |
99 | 99 | $this->assertEquals( DataTransclusionHandler::sanitizeValue( '* foo bar' ), '* foo bar' ); |
100 | 100 | $this->assertEquals( DataTransclusionHandler::sanitizeValue( 'foo*bar' ), 'foo*bar' ); |
— | — | @@ -237,7 +237,7 @@ |
238 | 238 | function testHandleRecordFunction() { |
239 | 239 | global $wgDataTransclusionSources; |
240 | 240 | |
241 | | - $data[] = array( "name" => "foo", "id" => "3", "info" => '<test>&[[X]]', "url" => 'http://test.org/', "evil" => 'javascript:alert("evil")' ); |
| 241 | + $data[] = array( "name" => "foo", "id" => "3", "info" => '<test>&[[X]]\'', "url" => 'http://test.org/', "evil" => 'javascript:alert("evil")' ); |
242 | 242 | $spec = array( |
243 | 243 | 'class' => 'FakeDataTransclusionSource', |
244 | 244 | 'data' => $data, |
— | — | @@ -257,7 +257,7 @@ |
258 | 258 | $wgParser->parse( $text, $title, $options ); |
259 | 259 | |
260 | 260 | $html = $wgParser->getOutput()->getText(); |
261 | | - $this->assertEquals( $html, '<p>xx FOO:<b>3</b>|foo|Hallo|<test>&[[X]]|<a href="http://test.org/" class="external text" rel="nofollow">link</a>|[javascript:alert("evil") click me] xx'."\n".'</p>' ); // XXX: should be more lenient wrt whitespace |
| 261 | + $this->assertEquals( $html, '<p>xx FOO:<b>3</b>|foo|Hallo|<test>&[[X]]'|<a href="http://test.org/" class="external text" rel="nofollow">link</a>|[javascript:alert("evil") click me] xx'."\n".'</p>' ); // XXX: should be more lenient wrt whitespace |
262 | 262 | $templates = $wgParser->getOutput()->getTemplates(); |
263 | 263 | $this->assertTrue( isset( $templates[ NS_TEMPLATE ]['Test'] ) ); |
264 | 264 | } |
— | — | @@ -265,7 +265,7 @@ |
266 | 266 | function testHandleRecordTag() { |
267 | 267 | global $wgDataTransclusionSources; |
268 | 268 | |
269 | | - $data[] = array( "name" => "foo", "id" => "3", "info" => '<test>&[[X]]', "url" => 'http://test.org/', "evil" => 'javascript:alert("evil")' ); |
| 269 | + $data[] = array( "name" => "foo", "id" => "3", "info" => '<test>&[[X]]\'', "url" => 'http://test.org/', "evil" => 'javascript:alert("evil")' ); |
270 | 270 | $spec = array( |
271 | 271 | 'class' => 'FakeDataTransclusionSource', |
272 | 272 | 'data' => $data, |
— | — | @@ -285,7 +285,7 @@ |
286 | 286 | $wgParser->parse( $text, $title, $options ); |
287 | 287 | |
288 | 288 | $html = $wgParser->getOutput()->getText(); |
289 | | - $this->assertEquals( $html, '<p>xx FOO:<b>3</b>|foo|Hallo|<test>&[[X]]|<a href="http://test.org/" class="external text" rel="nofollow">link</a>|[javascript:alert("evil") click me] xx'."\n".'</p>' ); // XXX: should be more lenient wrt whitespace |
| 289 | + $this->assertEquals( $html, '<p>xx FOO:<b>3</b>|foo|Hallo|<test>&[[X]]'|<a href="http://test.org/" class="external text" rel="nofollow">link</a>|[javascript:alert("evil") click me] xx'."\n".'</p>' ); // XXX: should be more lenient wrt whitespace |
290 | 290 | $templates = $wgParser->getOutput()->getTemplates(); |
291 | 291 | $this->assertTrue( isset( $templates[ NS_TEMPLATE ]['Test'] ) ); |
292 | 292 | } |