$this->mTitle =& $title;
$this->mOutputType = OT_HTML;
- $stripState = NULL;
+ $this->mStripState = NULL;
global $fnord; $fnord = 1;
//$text = $this->strip( $text, $this->mStripState );
// VOODOO MAGIC FIX! Sometimes the above segfaults in PHP5.
$x =& $this->mStripState;
$text = $this->strip( $text, $x );
- $text = $this->internalParse( $text, $linestart );
+ $text = $this->internalParse( $text );
$dashReplace = array(
'/ - /' => " – ", # N dash
# Extensions
foreach ( $this->mTagHooks as $tag => $callback ) {
- $ext_contents[$tag] = array();
+ $ext_content[$tag] = array();
$text = Parser::extractTags( $tag, $text, $ext_content[$tag], $uniq_prefix );
foreach( $ext_content[$tag] as $marker => $content ) {
if ( $render ) {
1 => array('pipe', 'w'),
2 => array('file', '/dev/null', 'a')
);
+ $pipes = array();
$process = proc_open("$wgTidyBin -config $wgTidyConf $wgTidyOpts$opts", $descriptorspec, $pipes);
if (is_resource($process)) {
fwrite($pipes[0], $text);
$cleansource .= fgets($pipes[1], 1024);
}
fclose($pipes[1]);
- $return_value = proc_close($process);
+ proc_close($process);
}
wfProfileOut( $fname );
}
$t = implode ( "\n" , $t ) ;
- # $t = Sanitizer::removeHTMLtags( $t );
wfProfileOut( $fname );
return $t ;
}
*
* @access private
*/
- function internalParse( $text, $linestart, $args = array(), $isMain=true ) {
+ function internalParse( $text ) {
global $wgContLang;
-
+ $args = array();
+ $isMain = true;
$fname = 'Parser::internalParse';
wfProfileIn( $fname );
* @access private
*/
function replaceInternalLinks( $s ) {
- global $wgLang, $wgContLang, $wgLinkCache;
- global $wgDisableLangConversion;
+ global $wgContLang, $wgLinkCache;
static $fname = 'Parser::replaceInternalLinks' ;
wfProfileIn( $fname );
# in Parser. Enable it, then disable it when we're done.
$saveParseColour = $sk->postParseLinkColour( !$wgUseOldExistenceCheck );
- $redirect = MagicWord::get ( MAG_REDIRECT ) ;
-
#split the entire text string on occurences of [[
$a = explode( '[[', ' ' . $s );
#get the first element (all text up to first [[), and remove the space we added
#
$textLines = explode( "\n", $text );
- $lastPrefix = $output = $lastLine = '';
+ $lastPrefix = $output = '';
$this->mDTopen = $inBlockElem = false;
$prefixLength = 0;
$paragraphStack = false;
# ; title : definition text
# So we check for : in the remainder text to split up the
# title and definition, without b0rking links.
+ $term = $t2 = '';
if ($this->findColonNoLinks($t, $term, $t2) !== false) {
$t = $t2;
$output .= $term . $this->nextItem( ':' );
* @access private
*/
function replaceVariables( $text, $args = array() ) {
- global $wgLang, $wgScript, $wgArticlePath;
# Prevent too big inclusions
if( strlen( $text ) > MAX_INCLUDE_SIZE ) {
'%' => '.'
);
$canonized_headline = str_replace(array_keys($replacearray),array_values($replacearray),$canonized_headline);
- $refer[$headlineCount] = $canonized_headline;
+ $refers[$headlineCount] = $canonized_headline;
# count how many in assoc. array so we can track dupes in anchors
@$refers[$canonized_headline]++;
}
if( $doShowToc ) {
- $toclines = $headlineCount;
$toc .= $sk->tocUnindent( $toclevel - 1 );
$toc = $sk->tocList( $toc );
}
* @access private
*/
function magicISBN( $text ) {
- global $wgLang;
$fname = 'Parser::magicISBN';
wfProfileIn( $fname );
* @return string
*/
function magicRFC( $text, $keyword='RFC ', $urlmsg='rfcurl' ) {
- global $wgLang;
$valid = '0123456789';
$internal = false;
$stripState = false;
$pairs = array(
"\r\n" => "\n",
- );
+ );
$text = str_replace( array_keys( $pairs ), array_values( $pairs ), $text );
$text = $this->strip( $text, $stripState, false );
$text = $this->pstPass2( $text, $user );
* @access private
*/
function pstPass2( $text, &$user ) {
- global $wgLang, $wgContLang, $wgLocaltimezone;
+ global $wgContLang, $wgLocaltimezone;
# Variable replacement
# Because mOutputType is OT_WIKI, this will only process {{subst:xxx}} type tags
$d = $wgContLang->timeanddate( wfTimestampNow(), false, false) .
' (' . date( 'T' ) . ')';
if ( isset( $wgLocaltimezone ) ) {
- putenv( 'TZ='.$oldtzs );
+ putenv( 'TZ='.$oldtz );
}
if( $user->getOption( 'fancysig' ) ) {