Page MenuHomePhabricator

Parser.php.patch

Authored By
bzimport
Nov 21 2014, 8:21 PM
Size
5 KB
Referenced Files
None
Subscribers
None

Parser.php.patch

Index: includes/Parser.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/Parser.php,v
retrieving revision 1.418
diff -u -r1.418 Parser.php
--- includes/Parser.php 19 Apr 2005 17:19:52 -0000 1.418
+++ includes/Parser.php 20 Apr 2005 01:59:50 -0000
@@ -165,14 +165,14 @@
$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
@@ -377,7 +377,7 @@
# 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 ) {
@@ -499,6 +499,7 @@
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], $wrappedtext);
@@ -507,7 +508,7 @@
$cleansource .= fgets($pipes[1], 1024);
}
fclose($pipes[1]);
- $return_value = proc_close($process);
+ proc_close($process);
}
wfProfileOut( $fname );
@@ -638,9 +639,10 @@
*
* @access private
*/
- function internalParse( $text, $linestart, $args = array(), $isMain=true ) {
+ function internalParse( $text ) {
global $wgContLang;
-
+ $args = array();
+ $isMain = true;
$fname = 'Parser::internalParse';
wfProfileIn( $fname );
@@ -1069,8 +1071,7 @@
* @access private
*/
function replaceInternalLinks( $s ) {
- global $wgLang, $wgContLang, $wgLinkCache;
- global $wgDisableLangConversion;
+ global $wgContLang, $wgLinkCache;
static $fname = 'Parser::replaceInternalLinks' ;
wfProfileIn( $fname );
@@ -1086,7 +1087,7 @@
# in Parser. Enable it, then disable it when we're done.
$saveParseColour = $sk->postParseLinkColour( !$wgUseOldExistenceCheck );
- $redirect = MagicWord::get ( MAG_REDIRECT ) ;
+ MagicWord::get ( MAG_REDIRECT ) ;
#split the entire text string on occurences of [[
$a = explode( '[[', ' ' . $s );
@@ -1509,7 +1510,7 @@
#
$textLines = explode( "\n", $text );
- $lastPrefix = $output = $lastLine = '';
+ $lastPrefix = $output = '';
$this->mDTopen = $inBlockElem = false;
$prefixLength = 0;
$paragraphStack = false;
@@ -1548,6 +1549,7 @@
# ; 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( ':' );
@@ -1784,7 +1786,6 @@
* @access private
*/
function replaceVariables( $text, $args = array() ) {
- global $wgLang, $wgScript, $wgArticlePath;
# Prevent too big inclusions
if( strlen( $text ) > MAX_INCLUDE_SIZE ) {
@@ -2196,7 +2197,7 @@
* @access private
*/
function formatHeadings( $text, $isMain=true ) {
- global $wgInputEncoding, $wgMaxTocLevel, $wgContLang, $wgLinkHolders, $wgInterwikiLinkHolders;
+ global $wgInputEncoding, $wgMaxTocLevel, $wgContLang;
$doNumberHeadings = $this->mOptions->getNumberHeadings();
$doShowToc = true;
@@ -2365,7 +2366,7 @@
'%' => '.'
);
$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]++;
@@ -2404,7 +2405,6 @@
}
if( $doShowToc ) {
- $toclines = $headlineCount;
$toc .= $sk->tocUnindent( $toclevel - 1 );
$toc = $sk->tocList( $toc );
}
@@ -2447,7 +2447,6 @@
* @access private
*/
function magicISBN( $text ) {
- global $wgLang;
$fname = 'Parser::magicISBN';
wfProfileIn( $fname );
@@ -2501,7 +2500,6 @@
* @return string
*/
function magicRFC( $text, $keyword='RFC ', $urlmsg='rfcurl' ) {
- global $wgLang;
$valid = '0123456789';
$internal = false;
@@ -2599,7 +2597,7 @@
* @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
@@ -2623,7 +2621,7 @@
$d = $wgContLang->timeanddate( wfTimestampNow(), false, false) .
' (' . date( 'T' ) . ')';
if ( isset( $wgLocaltimezone ) ) {
- putenv( 'TZ='.$oldtzs );
+ putenv( 'TZ='.$oldtz );
}
if( $user->getOption( 'fancysig' ) ) {

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1479
Default Alt Text
Parser.php.patch (5 KB)

Event Timeline