From: Tim Starling Date: Tue, 22 Jan 2008 10:10:21 +0000 (+0000) Subject: Fix for bug 12705. Fixed refreshLinks.php documentation. X-Git-Tag: 1.31.0-rc.0~49850 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=ee8d2940039a90ddb9150c7aefa29b7ce4822a3c;p=lhc%2Fweb%2Fwiklou.git Fix for bug 12705. Fixed refreshLinks.php documentation. --- diff --git a/includes/Parser.php b/includes/Parser.php index becda14476..c3b398da01 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -82,8 +82,9 @@ class Parser # Persistent: var $mTagHooks, $mTransparentTagHooks, $mFunctionHooks, $mFunctionSynonyms, $mVariables, $mImageParams, $mImageParamsMagicArray, $mStripList, $mMarkerSuffix, - $mExtLinkBracketedRegex, $mPreprocessor; - + $mExtLinkBracketedRegex, $mPreprocessor, $mDefaultStripList; + + # Cleared with clearState(): var $mOutput, $mAutonumber, $mDTopen, $mStripState; var $mIncludeCount, $mArgStack, $mLastSection, $mInPre; @@ -114,7 +115,7 @@ class Parser $this->mTransparentTagHooks = array(); $this->mFunctionHooks = array(); $this->mFunctionSynonyms = array( 0 => array(), 1 => array() ); - $this->mStripList = array( 'nowiki', 'gallery' ); + $this->mDefaultStripList = $this->mStripList = array( 'nowiki', 'gallery' ); $this->mMarkerSuffix = "-QINU\x7f"; $this->mExtLinkBracketedRegex = '/\[(\b(' . wfUrlProtocols() . ')'. '[^][<>"\\x00-\\x20\\x7F]+) *([^\]\\x0a\\x0d]*?)\]/S'; @@ -3854,6 +3855,14 @@ class Parser return $oldVal; } + /** + * Remove all tag hooks + */ + function clearTagHooks() { + $this->mTagHooks = array(); + $this->mStripList = $this->mDefaultStripList; + } + /** * Create a function, e.g. {{sum:1|2|3}} * The callback function should have the form: diff --git a/maintenance/refreshLinks.inc b/maintenance/refreshLinks.inc index 9e4eea8d6b..e89db8aa03 100644 --- a/maintenance/refreshLinks.inc +++ b/maintenance/refreshLinks.inc @@ -19,7 +19,7 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $red $wgUser->setOption('math', MW_MATH_SOURCE); # Don't generate extension images (e.g. Timeline) - $wgParser->mTagHooks = array(); + $wgParser->clearTagHooks(); # Don't generate thumbnail images $wgUseImageResize = false; diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index 923379e870..67fb77aebf 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -1,6 +1,5 @@ ] [-e ] [-m ] [--help] --help : This help message - --dfn-only : ??? - -m : Specifies max replication lag? Does it abort or wait if this - is exceeded? - start : First page id to refresh? Doesn't work with --dfn-only set? - -e : Last page id to refresh? - -This uses wfGetDB() to get the database, it seems not to accept a database ar- -gument on the command line. So I don't know if you can use it for non-default -configuration. - -Todo: Real documentation. + --dfn-only : Delete links from nonexistent articles only + -m : Maximum replication lag + : First page id to refresh + -e : Last page id to refresh TEXT; exit(0); @@ -35,7 +26,7 @@ TEXT; error_reporting( E_ALL & (~E_NOTICE) ); if ( !$options['dfn-only'] ) { - if ($args[0]) { + if ( isset( $args[0] ) ) { $start = (int)$args[0]; } else { $start = 1;