'wgSitename' => 'MediaWiki',
'wgLanguageCode' => $lang,
'wgDBprefix' => $this->db->getType() != 'oracle' ? 'parsertest_' : 'pt_',
- 'wgRawHtml' => isset( $opts['rawhtml'] ),
+ 'wgRawHtml' => self::getOptionValue( 'wgRawHtml', $opts, false ),
'wgLang' => null,
'wgContLang' => null,
'wgNamespacesWithSubpages' => array( 0 => isset( $opts['subpage'] ) ),
'wgSVGConverter' => 'null',
'wgSVGConverters' => array( 'null' => 'echo "1">$output' ),
'wgLocaltimezone' => 'UTC',
- 'wgAllowExternalImages' => true,
+ 'wgAllowExternalImages' => self::getOptionValue( 'wgAllowExternalImages', $opts, true ),
'wgUseTidy' => false,
'wgDefaultLanguageVariant' => $variant,
'wgVariantArticlePath' => false,
# comment run through Linker::formatComment() instead of main parser
# local format section links in edit comment text as local links
#
+# You can also set the following parser properties via test options:
+# wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel,
+# wgLinkHolderBatchSize, wgRawHtml
+#
# For testing purposes, temporary articles can created:
# !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
# where '/' denotes a newline.
</p>
!! end
+!! test
+External image (when not allowed)
+!! options
+wgAllowExternalImages=0
+!! input
+External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
+!! result
+<p>External image: <a rel="nofollow" class="external free" href="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png">http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png</a>
+</p>
+!! end
+
!! test
Link to non-http image, no img tag
!! input
!! test
HTML with raw HTML ($wgRawHtml==true)
!! options
-rawhtml
+wgRawHtml=1
!! input
<html><script>alert(1);</script></html>
!! result
'wgEnableUploads' => self::getOptionValue( 'wgEnableUploads', $opts, true ),
'wgLanguageCode' => $lang,
'wgDBprefix' => $this->db->getType() != 'oracle' ? 'unittest_' : 'ut_',
- 'wgRawHtml' => isset( $opts['rawhtml'] ),
+ 'wgRawHtml' => self::getOptionValue( 'wgRawHtml', $opts, false ),
'wgNamespacesWithSubpages' => array( NS_MAIN => isset( $opts['subpage'] ) ),
+ 'wgAllowExternalImages' => self::getOptionValue( 'wgAllowExternalImages', $opts, true ),
'wgMaxTocLevel' => $maxtoclevel,
'wgUseTeX' => isset( $opts['math'] ) || isset( $opts['texvc'] ),
'wgMathDirectory' => $uploadDir . '/math',