Changed what used to be EXT_LINK_TEXT_CLASS to
define( 'EXT_LINK_TEXT_CLASS', '[^\]\\x00-\\x08\\x0a-\\x1F]' );
In plain English, do not allow control characters in description. We still allow tabs
there, since they may arrive from a paste.
We should probably make the space between the text and the description mandatory, it needs testing.
These tests only work with the Hash Preprocessor, since the DOM Preprocessor changes them into the
replacement character. Should we autolink an URL with a FFFD? That will require changing some regex
into unicode ones.
*/
$wgParserTestFiles = array(
"$IP/maintenance/parserTests.txt",
*/
$wgParserTestFiles = array(
"$IP/maintenance/parserTests.txt",
+ "$IP/maintenance/ExtraParserTests.txt"
$this->mDefaultStripList = $this->mStripList = array();
$this->mUrlProtocols = wfUrlProtocols();
$this->mExtLinkBracketedRegex = '/\[(\b(' . wfUrlProtocols() . ')'.
$this->mDefaultStripList = $this->mStripList = array();
$this->mUrlProtocols = wfUrlProtocols();
$this->mExtLinkBracketedRegex = '/\[(\b(' . wfUrlProtocols() . ')'.
- '[^][<>"\\x00-\\x20\\x7F]+) *([^\]\\x0a\\x0d]*?)\]/S';
+ '[^][<>"\\x00-\\x20\\x7F]+) *([^\]\\x00-\\x08\\x0a-\\x1F]*?)\]/S';
$this->mVarCache = array();
if ( isset( $conf['preprocessorClass'] ) ) {
$this->mPreprocessorClass = $conf['preprocessorClass'];
$this->mVarCache = array();
if ( isset( $conf['preprocessorClass'] ) ) {
$this->mPreprocessorClass = $conf['preprocessorClass'];
/**
* Get a Parser object
*/
/**
* Get a Parser object
*/
+ function getParser($preprocessor = null) {
global $wgParserConf;
$class = $wgParserConf['class'];
global $wgParserConf;
$class = $wgParserConf['class'];
- $parser = new $class( $wgParserConf );
+ $parser = new $class( array( 'preprocessorClass'=>$preprocessor ) + $wgParserConf );
foreach( $this->hooks as $tag => $callback ) {
$parser->setHook( $tag, $callback );
}
foreach( $this->hooks as $tag => $callback ) {
$parser->setHook( $tag, $callback );
}
$noxml = isset( $opts['noxml'] );
$local = isset( $opts['local'] );
$noxml = isset( $opts['noxml'] );
$local = isset( $opts['local'] );
- $parser = $this->getParser();
+ $preprocessor = @$opts['preprocessor'];
+ $parser = $this->getParser( $preprocessor );
$title = Title::newFromText( $titleText );
$matches = array();
$title = Title::newFromText( $titleText );
$matches = array();
-!! test
-External links: invalid character
-Fixme: the missing char seems to have gone missing
-!! options
-disabled
-!! input
-[http://www.example.com test]
-!! result
-<p>[<a href="http://www.example.com" class="external free" rel="nofollow">http://www.example.com</a> test]
-</p>
-!! end
-
!! test
External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081)
!! input
!! test
External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081)
!! input