Index: trunk/phase3/includes/parser/LinkHolderArray.php |
— | — | @@ -104,16 +104,6 @@ |
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
108 | | - * Get the stub threshold |
109 | | - */ |
110 | | - function getStubThreshold() { |
111 | | - if ( !isset( $this->stubThreshold ) ) { |
112 | | - $this->stubThreshold = $this->parent->getUser()->getStubThreshold(); |
113 | | - } |
114 | | - return $this->stubThreshold; |
115 | | - } |
116 | | - |
117 | | - /** |
118 | 108 | * FIXME: update documentation. makeLinkObj() is deprecated. |
119 | 109 | * Replace <!--LINK--> link placeholders with actual links, in the buffer |
120 | 110 | * Placeholders created in Skin::makeLinkObj() |
— | — | @@ -148,7 +138,7 @@ |
149 | 139 | wfProfileIn( __METHOD__.'-check' ); |
150 | 140 | $dbr = wfGetDB( DB_SLAVE ); |
151 | 141 | $page = $dbr->tableName( 'page' ); |
152 | | - $threshold = $this->getStubThreshold(); |
| 142 | + $threshold = $this->parent->getOptions()->getStubThreshold(); |
153 | 143 | |
154 | 144 | # Sort by namespace |
155 | 145 | ksort( $this->internals ); |
— | — | @@ -305,7 +295,7 @@ |
306 | 296 | $output = $this->parent->getOutput(); |
307 | 297 | $linkCache = LinkCache::singleton(); |
308 | 298 | $sk = $this->parent->getOptions()->getSkin( $this->parent->mTitle ); |
309 | | - $threshold = $this->getStubThreshold(); |
| 299 | + $threshold = $this->parent->getOptions()->getStubThreshold(); |
310 | 300 | $titlesToBeConverted = ''; |
311 | 301 | $titlesAttrs = array(); |
312 | 302 | |
Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -41,6 +41,7 @@ |
42 | 42 | var $mNumberHeadings; # Automatically number headings |
43 | 43 | var $mMath; # User math preference (as integer) |
44 | 44 | var $mThumbSize; # Thumb size preferred by the user. |
| 45 | + private $mStubThreshold; # Maximum article size of an article to be marked as "stub" |
45 | 46 | var $mUserLang; # Language code of the User language. |
46 | 47 | |
47 | 48 | /** |
— | — | @@ -80,6 +81,8 @@ |
81 | 82 | return $this->mMath; } |
82 | 83 | function getThumbSize() { $this->optionUsed('thumbsize'); |
83 | 84 | return $this->mThumbSize; } |
| 85 | + function getStubThreshold() { $this->optionUsed('stubthreshold'); |
| 86 | + return $this->mStubThreshold; } |
84 | 87 | |
85 | 88 | function getIsPreview() { return $this->mIsPreview; } |
86 | 89 | function getIsSectionPreview() { return $this->mIsSectionPreview; } |
— | — | @@ -145,6 +148,7 @@ |
146 | 149 | function setMath( $x ) { return wfSetVar( $this->mMath, $x ); } |
147 | 150 | function setUserLang( $x ) { return wfSetVar( $this->mUserLang, $x ); } |
148 | 151 | function setThumbSize( $x ) { return wfSetVar( $this->mThumbSize, $x ); } |
| 152 | + function setStubThreshold( $x ) { return wfSetVar( $this->mStubThreshold, $x ); } |
149 | 153 | function setPreSaveTransform( $x ) { return wfSetVar( $this->mPreSaveTransform, $x ); } |
150 | 154 | |
151 | 155 | function setIsPreview( $x ) { return wfSetVar( $this->mIsPreview, $x ); } |
— | — | @@ -210,6 +214,7 @@ |
211 | 215 | $this->mNumberHeadings = $user->getOption( 'numberheadings' ); |
212 | 216 | $this->mMath = $user->getOption( 'math' ); |
213 | 217 | $this->mThumbSize = $user->getOption( 'thumbsize' ); |
| 218 | + $this->mStubThreshold = $user->getStubThreshold(); |
214 | 219 | $this->mUserLang = $wgLang->getCode(); |
215 | 220 | |
216 | 221 | wfProfileOut( __METHOD__ ); |
— | — | @@ -276,9 +281,8 @@ |
277 | 282 | // Space assigned for the stubthreshold but unused |
278 | 283 | // since it disables the parser cache, its value will always |
279 | 284 | // be 0 when this function is called by parsercache. |
280 | | - // The conditional is here to avoid a confusing 0 |
281 | | - if ( true || in_array( 'stubthreshold', $forOptions ) ) |
282 | | - $confstr .= '!0' ; |
| 285 | + if ( in_array( 'stubthreshold', $forOptions ) ) |
| 286 | + $confstr .= '!' . $this->mStubThreshold; |
283 | 287 | else |
284 | 288 | $confstr .= '!*' ; |
285 | 289 | |