public function __construct( $conf = array() ) {
$this->mConf = $conf;
$this->mUrlProtocols = wfUrlProtocols();
- $this->mExtLinkBracketedRegex = '/\[(((?i)' . $this->mUrlProtocols . ')'.
- self::EXT_LINK_URL_CLASS.'+)\p{Zs}*([^\]\\x00-\\x08\\x0a-\\x1F]*?)\]/Su';
+ $this->mExtLinkBracketedRegex = '/\[(((?i)' . $this->mUrlProtocols . ')' .
+ self::EXT_LINK_URL_CLASS . '+)\p{Zs}*([^\]\\x00-\\x08\\x0a-\\x1F]*?)\]/Su';
if ( isset( $conf['preprocessorClass'] ) ) {
$this->mPreprocessorClass = $conf['preprocessorClass'];
} elseif ( defined( 'MW_COMPILED' ) ) {
*/
global $wgUseTidy, $wgAlwaysUseTidy;
- $fname = __METHOD__.'-' . wfGetCaller();
+ $fname = __METHOD__ . '-' . wfGetCaller();
wfProfileIn( __METHOD__ );
wfProfileIn( $fname );
"Preprocessor generated node count: " .
"{$this->mGeneratedPPNodeCount}/{$this->mOptions->getMaxGeneratedPPNodeCount()}\n" .
"Post-expand include size: {$this->mIncludeSizes['post-expand']}/$max bytes\n" .
- "Template argument size: {$this->mIncludeSizes['arg']}/$max bytes\n".
- "Highest expansion depth: {$this->mHighestExpansionDepth}/{$this->mOptions->getMaxPPExpandDepth()}\n".
+ "Template argument size: {$this->mIncludeSizes['arg']}/$max bytes\n" .
+ "Highest expansion depth: {$this->mHighestExpansionDepth}/{$this->mOptions->getMaxPPExpandDepth()}\n" .
$PFreport;
wfRunHooks( 'ParserLimitReport', array( $this, &$limitReport ) );
$text .= "\n<!-- \n$limitReport-->\n";
*
* @return string
*/
- static public function getRandomString() {
+ public static function getRandomString() {
return wfRandomString( 16 );
}
$line = trim( $outLine );
if ( $line === '' ) { # empty line, go to next line
- $out .= $outLine."\n";
+ $out .= $outLine . "\n";
continue;
}
$first_character = $line[0];
$matches = array();
- if ( preg_match( '/^(:*)\{\|(.*)$/', $line , $matches ) ) {
+ if ( preg_match( '/^(:*)\{\|(.*)$/', $line, $matches ) ) {
# First check if we are starting a new table
$indent_level = strlen( $matches[1] );
$attributes = $this->mStripState->unstripBoth( $matches[2] );
- $attributes = Sanitizer::fixTagAttributes( $attributes , 'table' );
-
- $outLine = str_repeat( '<dl><dd>' , $indent_level ) . "<table{$attributes}>";
- array_push( $td_history , false );
- array_push( $last_tag_history , '' );
- array_push( $tr_history , false );
- array_push( $tr_attributes , '' );
- array_push( $has_opened_tr , false );
+ $attributes = Sanitizer::fixTagAttributes( $attributes, 'table' );
+
+ $outLine = str_repeat( '<dl><dd>', $indent_level ) . "<table{$attributes}>";
+ array_push( $td_history, false );
+ array_push( $last_tag_history, '' );
+ array_push( $tr_history, false );
+ array_push( $tr_attributes, '' );
+ array_push( $has_opened_tr, false );
} elseif ( count( $td_history ) == 0 ) {
# Don't do any of the following
- $out .= $outLine."\n";
+ $out .= $outLine . "\n";
continue;
- } elseif ( substr( $line , 0 , 2 ) === '|}' ) {
+ } elseif ( substr( $line, 0, 2 ) === '|}' ) {
# We are ending a table
- $line = '</table>' . substr( $line , 2 );
+ $line = '</table>' . substr( $line, 2 );
$last_tag = array_pop( $last_tag_history );
if ( !array_pop( $has_opened_tr ) ) {
$line = "</{$last_tag}>{$line}";
}
array_pop( $tr_attributes );
- $outLine = $line . str_repeat( '</dd></dl>' , $indent_level );
- } elseif ( substr( $line , 0 , 2 ) === '|-' ) {
+ $outLine = $line . str_repeat( '</dd></dl>', $indent_level );
+ } elseif ( substr( $line, 0, 2 ) === '|-' ) {
# Now we have a table row
$line = preg_replace( '#^\|-+#', '', $line );
$line = '';
$last_tag = array_pop( $last_tag_history );
array_pop( $has_opened_tr );
- array_push( $has_opened_tr , true );
+ array_push( $has_opened_tr, true );
if ( array_pop( $tr_history ) ) {
$line = '</tr>';
}
$outLine = $line;
- array_push( $tr_history , false );
- array_push( $td_history , false );
- array_push( $last_tag_history , '' );
- } elseif ( $first_character === '|' || $first_character === '!' || substr( $line , 0 , 2 ) === '|+' ) {
+ array_push( $tr_history, false );
+ array_push( $td_history, false );
+ array_push( $last_tag_history, '' );
+ } elseif ( $first_character === '|' || $first_character === '!' || substr( $line, 0, 2 ) === '|+' ) {
# This might be cell elements, td, th or captions
- if ( substr( $line , 0 , 2 ) === '|+' ) {
+ if ( substr( $line, 0, 2 ) === '|+' ) {
$first_character = '+';
- $line = substr( $line , 1 );
+ $line = substr( $line, 1 );
}
- $line = substr( $line , 1 );
+ $line = substr( $line, 1 );
if ( $first_character === '!' ) {
- $line = str_replace( '!!' , '||' , $line );
+ $line = str_replace( '!!', '||', $line );
}
# Split up multiple cells on the same line.
# FIXME : This can result in improper nesting of tags processed
# by earlier parser steps, but should avoid splitting up eg
# attribute values containing literal "||".
- $cells = StringUtils::explodeMarkup( '||' , $line );
+ $cells = StringUtils::explodeMarkup( '||', $line );
$outLine = '';
if ( !array_pop( $tr_history ) ) {
$previous = "<tr{$tr_after}>\n";
}
- array_push( $tr_history , true );
- array_push( $tr_attributes , '' );
+ array_push( $tr_history, true );
+ array_push( $tr_attributes, '' );
array_pop( $has_opened_tr );
- array_push( $has_opened_tr , true );
+ array_push( $has_opened_tr, true );
}
$last_tag = array_pop( $last_tag_history );
$last_tag = '';
}
- array_push( $last_tag_history , $last_tag );
+ array_push( $last_tag_history, $last_tag );
# A cell could contain both parameters and data
- $cell_data = explode( '|' , $cell , 2 );
+ $cell_data = explode( '|', $cell, 2 );
# Bug 553: Note that a '|' inside an invalid link should not
# be mistaken as delimiting cell parameters
$cell = "{$previous}<{$last_tag}>{$cell_data[0]}";
} else {
$attributes = $this->mStripState->unstripBoth( $cell_data[0] );
- $attributes = Sanitizer::fixTagAttributes( $attributes , $last_tag );
+ $attributes = Sanitizer::fixTagAttributes( $attributes, $last_tag );
$cell = "{$previous}<{$last_tag}{$attributes}>{$cell_data[1]}";
}
$outLine .= $cell;
- array_push( $td_history , true );
+ array_push( $td_history, true );
}
}
$out .= $outLine . "\n";
# replaceInternalLinks may sometimes leave behind
# absolute URLs, which have to be masked to hide them from replaceExternalLinks
- $text = str_replace( $this->mUniqPrefix.'NOPARSE', '', $text );
+ $text = str_replace( $this->mUniqPrefix . 'NOPARSE', '', $text );
$text = $this->doMagicLinks( $text );
$text = $this->formatHeadings( $text, $origText, $isMain );
$CssClass = 'mw-magiclink-pmid';
$id = $m[4];
} else {
- throw new MWException( __METHOD__.': unrecognised match type "' .
+ throw new MWException( __METHOD__ . ': unrecognised match type "' .
substr( $m[0], 0, 20 ) . '"' );
}
$url = wfMessage( $urlmsg, $id )->inContentLanguage()->text();
wfProfileIn( __METHOD__ );
for ( $i = 6; $i >= 1; --$i ) {
$h = str_repeat( '=', $i );
- $text = preg_replace( "/^$h(.+)$h\\s*$/m",
- "<h$i>\\1</h$i>", $text );
+ $text = preg_replace( "/^$h(.+)$h\\s*$/m", "<h$i>\\1</h$i>", $text );
}
wfProfileOut( __METHOD__ );
return $text;
foreach ( $lines as $line ) {
$outtext .= $this->doQuotes( $line ) . "\n";
}
- $outtext = substr( $outtext, 0,-1 );
+ $outtext = substr( $outtext, 0, -1 );
wfProfileOut( __METHOD__ );
return $outtext;
}
} elseif ( $state === 'ib' ) {
$output .= '</b></i><b>'; $state = 'b';
} elseif ( $state === 'both' ) {
- $output .= '<b><i>'.$buffer.'</i>'; $state = 'b';
+ $output .= '<b><i>' . $buffer . '</i>'; $state = 'b';
} else { # $state can be 'b' or ''
$output .= '<i>'; $state .= 'i';
}
} elseif ( $state === 'ib' ) {
$output .= '</b>'; $state = 'i';
} elseif ( $state === 'both' ) {
- $output .= '<i><b>'.$buffer.'</b>'; $state = 'i';
+ $output .= '<i><b>' . $buffer . '</b>'; $state = 'i';
} else { # $state can be 'i' or ''
$output .= '<b>'; $state .= 'b';
}
} elseif ( $state === 'ib' ) {
$output .= '</b></i>'; $state = '';
} elseif ( $state === 'both' ) {
- $output .= '<i><b>'.$buffer.'</b></i>'; $state = '';
+ $output .= '<i><b>' . $buffer . '</b></i>'; $state = '';
} else { # ($state == '')
$buffer = ''; $state = 'both';
}
}
# There might be lonely ''''', so make sure we have a buffer
if ( $state === 'both' && $buffer ) {
- $output .= '<b><i>'.$buffer.'</i></b>';
+ $output .= '<b><i>' . $buffer . '</i></b>';
}
return $output;
}
function replaceInternalLinks2( &$s ) {
wfProfileIn( __METHOD__ );
- wfProfileIn( __METHOD__.'-setup' );
+ wfProfileIn( __METHOD__ . '-setup' );
static $tc = FALSE, $e1, $e1_img;
# the % is needed to support urlencoded titles as well
if ( !$tc ) {
}
if ( is_null( $this->mTitle ) ) {
- wfProfileOut( __METHOD__.'-setup' );
+ wfProfileOut( __METHOD__ . '-setup' );
wfProfileOut( __METHOD__ );
- throw new MWException( __METHOD__.": \$this->mTitle is null\n" );
+ throw new MWException( __METHOD__ . ": \$this->mTitle is null\n" );
}
$nottalk = !$this->mTitle->isTalkPage();
$selflink = array( $this->mTitle->getPrefixedText() );
}
$useSubpages = $this->areSubpagesAllowed();
- wfProfileOut( __METHOD__.'-setup' );
+ wfProfileOut( __METHOD__ . '-setup' );
# Loop for each link
for ( ; $line !== false && $line !== null ; $a->next(), $line = $a->current() ) {
}
if ( $useLinkPrefixExtension ) {
- wfProfileIn( __METHOD__.'-prefixhandling' );
+ wfProfileIn( __METHOD__ . '-prefixhandling' );
if ( preg_match( $e2, $s, $m ) ) {
$prefix = $m[2];
$s = $m[1];
} else {
- $prefix='';
+ $prefix = '';
}
# first link
if ( $first_prefix ) {
$prefix = $first_prefix;
$first_prefix = false;
}
- wfProfileOut( __METHOD__.'-prefixhandling' );
+ wfProfileOut( __METHOD__ . '-prefixhandling' );
}
$might_be_img = false;
- wfProfileIn( __METHOD__."-e1" );
+ wfProfileIn( __METHOD__ . "-e1" );
if ( preg_match( $e1, $line, $m ) ) { # page with normal text or alt
$text = $m[2];
# If we get a ] at the beginning of $m[3] that means we have a link that's something like:
$trail = "";
} else { # Invalid form; output directly
$s .= $prefix . '[[' . $line ;
- wfProfileOut( __METHOD__."-e1" );
+ wfProfileOut( __METHOD__ . "-e1" );
continue;
}
- wfProfileOut( __METHOD__."-e1" );
- wfProfileIn( __METHOD__."-misc" );
+ wfProfileOut( __METHOD__ . "-e1" );
+ wfProfileIn( __METHOD__ . "-misc" );
# Don't allow internal links to pages containing
# PROTO: where PROTO is a valid URL protocol; these
# should be external links.
if ( preg_match( '/^(?i:' . $this->mUrlProtocols . ')/', $m[1] ) ) {
$s .= $prefix . '[[' . $line ;
- wfProfileOut( __METHOD__."-misc" );
+ wfProfileOut( __METHOD__ . "-misc" );
continue;
}
$link = substr( $link, 1 );
}
- wfProfileOut( __METHOD__."-misc" );
- wfProfileIn( __METHOD__."-title" );
+ wfProfileOut( __METHOD__ . "-misc" );
+ wfProfileIn( __METHOD__ . "-title" );
$nt = Title::newFromText( $this->mStripState->unstripNoWiki( $link ) );
if ( $nt === null ) {
$s .= $prefix . '[[' . $line;
- wfProfileOut( __METHOD__."-title" );
+ wfProfileOut( __METHOD__ . "-title" );
continue;
}
$ns = $nt->getNamespace();
$iw = $nt->getInterWiki();
- wfProfileOut( __METHOD__."-title" );
+ wfProfileOut( __METHOD__ . "-title" );
if ( $might_be_img ) { # if this is actually an invalid link
- wfProfileIn( __METHOD__."-might_be_img" );
+ wfProfileIn( __METHOD__ . "-might_be_img" );
if ( $ns == NS_FILE && $noforce ) { # but might be an image
$found = false;
while ( true ) {
$holders->merge( $this->replaceInternalLinks2( $text ) );
$s .= "{$prefix}[[$link|$text";
# note: no $trail, because without an end, there *is* no trail
- wfProfileOut( __METHOD__."-might_be_img" );
+ wfProfileOut( __METHOD__ . "-might_be_img" );
continue;
}
} else { # it's not an image, so output it raw
$s .= "{$prefix}[[$link|$text";
# note: no $trail, because without an end, there *is* no trail
- wfProfileOut( __METHOD__."-might_be_img" );
+ wfProfileOut( __METHOD__ . "-might_be_img" );
continue;
}
- wfProfileOut( __METHOD__."-might_be_img" );
+ wfProfileOut( __METHOD__ . "-might_be_img" );
}
$wasblank = ( $text == '' );
# Link not escaped by : , create the various objects
if ( $noforce ) {
# Interwikis
- wfProfileIn( __METHOD__."-interwiki" );
+ wfProfileIn( __METHOD__ . "-interwiki" );
if ( $iw && $this->mOptions->getInterwikiMagic() && $nottalk && Language::fetchLanguageName( $iw, null, 'mw' ) ) {
// XXX: the above check prevents links to sites with identifiers that are not language codes
$s = rtrim( $s . $prefix );
$s .= trim( $trail, "\n" ) == '' ? '': $prefix . $trail;
- wfProfileOut( __METHOD__."-interwiki" );
+ wfProfileOut( __METHOD__ . "-interwiki" );
continue;
}
- wfProfileOut( __METHOD__."-interwiki" );
+ wfProfileOut( __METHOD__ . "-interwiki" );
if ( $ns == NS_FILE ) {
- wfProfileIn( __METHOD__."-image" );
+ wfProfileIn( __METHOD__ . "-image" );
if ( !wfIsBadImage( $nt->getDBkey(), $this->mTitle ) ) {
if ( $wasblank ) {
# if no parameters were passed, $text
} else {
$s .= $prefix . $trail;
}
- wfProfileOut( __METHOD__."-image" );
+ wfProfileOut( __METHOD__ . "-image" );
continue;
}
if ( $ns == NS_CATEGORY ) {
- wfProfileIn( __METHOD__."-category" );
+ wfProfileIn( __METHOD__ . "-category" );
$s = rtrim( $s . "\n" ); # bug 87
if ( $wasblank ) {
*/
$s .= trim( $prefix . $trail, "\n" ) == '' ? '' : $prefix . $trail;
- wfProfileOut( __METHOD__."-category" );
+ wfProfileOut( __METHOD__ . "-category" );
continue;
}
}
# NS_MEDIA is a pseudo-namespace for linking directly to a file
# @todo FIXME: Should do batch file existence checks, see comment below
if ( $ns == NS_MEDIA ) {
- wfProfileIn( __METHOD__."-media" );
+ wfProfileIn( __METHOD__ . "-media" );
# Give extensions a chance to select the file revision for us
$options = array();
$descQuery = false;
# Cloak with NOPARSE to avoid replacement in replaceExternalLinks
$s .= $prefix . $this->armorLinks(
Linker::makeMediaLinkFile( $nt, $file, $text ) ) . $trail;
- wfProfileOut( __METHOD__."-media" );
+ wfProfileOut( __METHOD__ . "-media" );
continue;
}
- wfProfileIn( __METHOD__."-always_known" );
+ wfProfileIn( __METHOD__ . "-always_known" );
# Some titles, such as valid special pages or files in foreign repos, should
# be shown as bluelinks even though they're not included in the page table
#
# Links will be added to the output link list after checking
$s .= $holders->makeHolder( $nt, $text, array(), $trail, $prefix );
}
- wfProfileOut( __METHOD__."-always_known" );
+ wfProfileOut( __METHOD__ . "-always_known" );
}
wfProfileOut( __METHOD__ );
return $holders;
} else {
return '<!-- ERR 3 -->';
}
- return $text."\n";
+ return $text . "\n";
}
/**#@-*/
# If we have no prefixes, go to paragraph mode.
if ( 0 == $prefixLength ) {
- wfProfileIn( __METHOD__."-paragraph" );
+ wfProfileIn( __METHOD__ . "-paragraph" );
# No prefix (not in list)--go to paragraph mode
# XXX: use a stack for nestable elements like span, table and div
$openmatch = preg_match('/(?:<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<dl|<li|<\\/tr|<\\/td|<\\/th)/iS', $t );
$closematch = preg_match(
'/(?:<\\/table|<\\/blockquote|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|'.
- '<td|<th|<\\/?div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<\\/dl|<\\/?center)/iS', $t );
+ '<td|<th|<\\/?div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix . '-pre|<\\/li|<\\/ul|<\\/ol|<\\/dl|<\\/?center)/iS', $t );
if ( $openmatch or $closematch ) {
$paragraphStack = false;
# TODO bug 5718: paragraph closed
# pre
if ( $this->mLastSection !== 'pre' ) {
$paragraphStack = false;
- $output .= $this->closeParagraph().'<pre>';
+ $output .= $this->closeParagraph() . '<pre>';
$this->mLastSection = 'pre';
}
$t = substr( $t, 1 );
# paragraph
if ( trim( $t ) === '' ) {
if ( $paragraphStack ) {
- $output .= $paragraphStack.'<br />';
+ $output .= $paragraphStack . '<br />';
$paragraphStack = false;
$this->mLastSection = 'p';
} else {
$paragraphStack = false;
$this->mLastSection = 'p';
} elseif ( $this->mLastSection !== 'p' ) {
- $output .= $this->closeParagraph().'<p>';
+ $output .= $this->closeParagraph() . '<p>';
$this->mLastSection = 'p';
}
}
}
}
- wfProfileOut( __METHOD__."-paragraph" );
+ wfProfileOut( __METHOD__ . "-paragraph" );
}
# somewhere above we forget to get out of pre block (bug 785)
if ( $preCloseMatch && $this->mInPre ) {
$this->mInPre = false;
}
if ( $paragraphStack === false ) {
- $output .= $t."\n";
+ $output .= $t . "\n";
}
}
while ( $prefixLength ) {
if ( $c === ">" ) {
$stack--;
if ( $stack < 0 ) {
- wfDebug( __METHOD__.": Invalid input; too many close tags\n" );
+ wfDebug( __METHOD__ . ": Invalid input; too many close tags\n" );
wfProfileOut( __METHOD__ );
return false;
}
}
}
if ( $stack > 0 ) {
- wfDebug( __METHOD__.": Invalid input; not enough close tags (stack $stack, state $state)\n" );
+ wfDebug( __METHOD__ . ": Invalid input; not enough close tags (stack $stack, state $state)\n" );
wfProfileOut( __METHOD__ );
return false;
}
$value = $this->getRevisionUser();
break;
case 'namespace':
- $value = str_replace( '_',' ',$wgContLang->getNsText( $this->mTitle->getNamespace() ) );
+ $value = str_replace( '_', ' ', $wgContLang->getNsText( $this->mTitle->getNamespace() ) );
break;
case 'namespacee':
$value = wfUrlencode( $wgContLang->getNsText( $this->mTitle->getNamespace() ) );
$value = $this->mTitle->getNamespace();
break;
case 'talkspace':
- $value = $this->mTitle->canTalk() ? str_replace( '_',' ',$this->mTitle->getTalkNsText() ) : '';
+ $value = $this->mTitle->canTalk() ? str_replace( '_', ' ', $this->mTitle->getTalkNsText() ) : '';
break;
case 'talkspacee':
$value = $this->mTitle->canTalk() ? wfUrlencode( $this->mTitle->getTalkNsText() ) : '';
if ( $frame === false ) {
$frame = $this->getPreprocessor()->newFrame();
} elseif ( !( $frame instanceof PPFrame ) ) {
- wfDebug( __METHOD__." called using plain parameters instead of a PPFrame instance. Creating custom frame.\n" );
+ wfDebug( __METHOD__ . " called using plain parameters instead of a PPFrame instance. Creating custom frame.\n" );
$frame = $this->getPreprocessor()->newCustomFrame( $frame );
}
function braceSubstitution( $piece, $frame ) {
global $wgContLang;
wfProfileIn( __METHOD__ );
- wfProfileIn( __METHOD__.'-setup' );
+ wfProfileIn( __METHOD__ . '-setup' );
# Flags
$found = false; # $text has been filled
# $args is a list of argument nodes, starting from index 0, not including $part1
# @todo FIXME: If piece['parts'] is null then the call to getLength() below won't work b/c this $args isn't an object
$args = ( null == $piece['parts'] ) ? array() : $piece['parts'];
- wfProfileOut( __METHOD__.'-setup' );
+ wfProfileOut( __METHOD__ . '-setup' );
$titleProfileIn = null; // profile templates
# SUBST
- wfProfileIn( __METHOD__.'-modifiers' );
+ wfProfileIn( __METHOD__ . '-modifiers' );
if ( !$found ) {
$substMatch = $this->mSubstWords->matchStartAndRemove( $part1 );
$forceRawInterwiki = true;
}
}
- wfProfileOut( __METHOD__.'-modifiers' );
+ wfProfileOut( __METHOD__ . '-modifiers' );
# Parser functions
if ( !$found ) {
}
} elseif ( MWNamespace::isNonincludable( $title->getNamespace() ) ) {
$found = false; # access denied
- wfDebug( __METHOD__.": template inclusion denied for " . $title->getPrefixedDBkey() );
+ wfDebug( __METHOD__ . ": template inclusion denied for " . $title->getPrefixedDBkey() );
} else {
list( $text, $title ) = $this->getTemplateDom( $title );
if ( $text !== false ) {
$text = '<span class="error">'
. wfMessage( 'parser-template-loop-warning', $titleText )->inContentLanguage()->text()
. '</span>';
- wfDebug( __METHOD__.": template loop broken at '$titleText'\n" );
+ wfDebug( __METHOD__ . ": template loop broken at '$titleText'\n" );
}
wfProfileOut( __METHOD__ . '-loadtpl' );
}
} elseif ( $markerType === 'general' ) {
$this->mStripState->addGeneral( $marker, $output );
} else {
- throw new MWException( __METHOD__.': invalid marker type' );
+ throw new MWException( __METHOD__ . ': invalid marker type' );
}
return $marker;
}
*/
public function addTrackingCategory( $msg ) {
if ( $this->mTitle->getNamespace() === NS_SPECIAL ) {
- wfDebug( __METHOD__.": Not adding tracking category $msg to special page!\n" );
+ wfDebug( __METHOD__ . ": Not adding tracking category $msg to special page!\n" );
return false;
}
// Important to parse with correct title (bug 31469)
$this->mOutput->addCategory( $containerCategory->getDBkey(), $this->getDefaultSort() );
return true;
} else {
- wfDebug( __METHOD__.": [[MediaWiki:$msg]] is not a valid title!\n" );
+ wfDebug( __METHOD__ . ": [[MediaWiki:$msg]] is not a valid title!\n" );
return false;
}
}
// of data, but put the headline hint inside a content block because the language converter is supposed to
// be able to convert that piece of data.
$editlink = '<mw:editsection page="' . htmlspecialchars($editlinkArgs[0]);
- $editlink .= '" section="' . htmlspecialchars($editlinkArgs[1]) .'"';
+ $editlink .= '" section="' . htmlspecialchars($editlinkArgs[1]) . '"';
if ( isset($editlinkArgs[2]) ) {
$editlink .= '>' . $editlinkArgs[2] . '</mw:editsection>';
} else {
} else {
# Failed to validate; fall back to the default
$nickname = $username;
- wfDebug( __METHOD__.": $username has bad XML tags in signature.\n" );
+ wfDebug( __METHOD__ . ": $username has bad XML tags in signature.\n" );
}
}
# Add to function cache
$mw = MagicWord::get( $id );
if ( !$mw )
- throw new MWException( __METHOD__.'() expecting a magic word identifier.' );
+ throw new MWException( __METHOD__ . '() expecting a magic word identifier.' );
$synonyms = $mw->getSynonyms();
$sensitive = intval( $mw->isCaseSensitive() );
if ( $match = $magicWordAlt->matchVariableStartToEnd( $parameterMatch ) ) {
$alt = $this->stripAltText( $match, false );
}
- elseif( $match = $magicWordLink->matchVariableStartToEnd( $parameterMatch ) ){
+ elseif( $match = $magicWordLink->matchVariableStartToEnd( $parameterMatch ) ) {
$linkValue = strip_tags( $this->replaceLinkHoldersText( $match ) );
$chars = self::EXT_LINK_URL_CLASS;
$prots = $this->mUrlProtocols;
$label = substr( $label, 1 );
}
- $ig->add( $title, $label, $alt ,$link);
+ $ig->add( $title, $label, $alt, $link );
}
return $ig->toHTML();
}
*/
function unserializeHalfParsedText( $data ) {
if ( !isset( $data['version'] ) || $data['version'] != self::HALF_PARSED_VERSION ) {
- throw new MWException( __METHOD__.': invalid version' );
+ throw new MWException( __METHOD__ . ': invalid version' );
}
# First, extract the strip state.