Index: trunk/extensions/ArticleComments/ArticleComments.php |
— | — | @@ -93,9 +93,9 @@ |
94 | 94 | * @param Title $title The title of the article on which the form will appear. |
95 | 95 | * @param Array $params A hash of parameters containing rendering options. |
96 | 96 | */ |
97 | | -function displayArticleCommentForm( $nsList = null, $title = null, $params = array() ) { |
| 97 | +function displayArticleCommentForm( $title = null, $params = array() ) { |
98 | 98 | |
99 | | - global $wgRequest; |
| 99 | + global $wgRequest, $wgArticleCommentsNSDisplayList; |
100 | 100 | |
101 | 101 | # Short circuit for anything other than action=view or action=purge |
102 | 102 | if ($wgRequest->getVal('action') && |
— | — | @@ -103,20 +103,17 @@ |
104 | 104 | $wgRequest->getVal('action')!='purge' |
105 | 105 | ) return; |
106 | 106 | |
| 107 | + # Short-circuit if displayl ist is undefined or null |
| 108 | + if ($wgArticleCommentsNSDisplayList==null) return; |
| 109 | + |
107 | 110 | # Use wgTitle if title is not specified |
108 | 111 | if ($title==null) { |
109 | 112 | global $wgTitle; |
110 | 113 | $title = $wgTitle; |
111 | 114 | } |
112 | 115 | |
113 | | - # Use wgArticleCommentsNSDisplayList if nsList is not specified |
114 | | - if ($nsList==null) { |
115 | | - global $wgArticleCommentsNSDisplayList; |
116 | | - $nsList = $wgArticleCommentsNSDisplayList; |
117 | | - $nsList = ($nsList==null?array(NS_MAIN):$nsList); |
118 | | - } |
119 | | - |
120 | 116 | # Ensure that the namespace list is an actual list |
| 117 | + $nsList = $wgArticleCommentsNSDisplayList; |
121 | 118 | if (!is_array($nsList)) $nsList = array($nsList); |
122 | 119 | |
123 | 120 | # Display the form |
— | — | @@ -355,11 +352,12 @@ |
356 | 353 | } |
357 | 354 | |
358 | 355 | |
359 | | - # Check if talk NS is in the Namespace whitelist |
360 | | - global $wgArticleCommentsNSWhitelist; |
| 356 | + # Check if talk NS is in the Namespace display list |
| 357 | + # Note: if so, then there's no need to confirm that <comments /> appears in the article or talk page. |
| 358 | + global $wgArticleCommentsNSDisplayList; |
361 | 359 | $skipCheck = ( |
362 | | - is_array($wgArticleCommentsNSWhitelist) ? |
363 | | - in_array($talkTitle->getNamespace(),$wgArticleCommentsNSWhitelist): |
| 360 | + is_array($wgArticleCommentsNSDisplayList) ? |
| 361 | + in_array($talkTitle->getNamespace(),$wgArticleCommentsNSDisplayList): |
364 | 362 | false |
365 | 363 | ); |
366 | 364 | |