Index: trunk/extensions/HelpCommons/HelpCommons.php |
— | — | @@ -55,12 +55,12 @@ |
56 | 56 | |
57 | 57 | foreach ( $wgHelpCommonsFetchingWikis as $language => $urls ) { |
58 | 58 | foreach ( $urls as $helpwiki ) { |
59 | | - if ( $wgLanguageCode == "$language" && $wgDBname != $helpwiki ) { |
| 59 | + if ( $wgLanguageCode == $language && $wgDBname != $helpwiki ) { |
60 | 60 | $dbr = wfGetDB( DB_SLAVE, array(), $helpwiki ); |
61 | 61 | $page = $dbr->select( |
62 | 62 | 'page', |
63 | 63 | array( 'page_title', 'page_namespace', 'page_latest' ), |
64 | | - array( 'page_namespace' => constant( 'NS_HELP' ), 'page_title' => $title ), |
| 64 | + array( 'page_namespace' => NS_HELP, 'page_title' => $title ), |
65 | 65 | __METHOD__ |
66 | 66 | ); |
67 | 67 | $page = $dbr->fetchObject( $page ); |
— | — | @@ -109,12 +109,12 @@ |
110 | 110 | |
111 | 111 | foreach ( $wgHelpCommonsFetchingWikis as $language => $urls ) { |
112 | 112 | foreach ( $urls as $url => $helpwiki ) { |
113 | | - if ( $wgLanguageCode == "$language" && $wgDBname != $helpwiki ) { |
| 113 | + if ( $wgLanguageCode == $language && $wgDBname != $helpwiki ) { |
114 | 114 | $dbr = wfGetDB( DB_SLAVE, array(), $helpwiki ); |
115 | 115 | $page = $dbr->select( |
116 | 116 | 'page', |
117 | 117 | array( 'page_title', 'page_namespace', 'page_latest' ), |
118 | | - array( 'page_namespace' => constant( 'NS_HELP' ), 'page_title' => $title ), |
| 118 | + array( 'page_namespace' => NS_HELP, 'page_title' => $title ), |
119 | 119 | __METHOD__ |
120 | 120 | ); |
121 | 121 | $page = $dbr->fetchObject( $page ); |
— | — | @@ -184,7 +184,7 @@ |
185 | 185 | } |
186 | 186 | foreach ( $wgHelpCommonsFetchingWikis as $language => $urls ) { |
187 | 187 | foreach ( $urls as $url => $helpwiki ) { |
188 | | - if ( $wgLanguageCode == "$language" && $wgDBname != $helpwiki ) { |
| 188 | + if ( $wgLanguageCode == $language && $wgDBname != $helpwiki ) { |
189 | 189 | // FIXME: $result is unused |
190 | 190 | $result = '<span class="editsection">[<a href="' . $url . '/index.php?title=' . |
191 | 191 | str_replace( ' ', '_', $title ) . '&action=edit&section=' . $section . |
— | — | @@ -208,7 +208,7 @@ |
209 | 209 | foreach ( $wgHelpCommonsFetchingWikis as $language => $urls ) { |
210 | 210 | foreach ( $urls as $url => $helpwiki ) { |
211 | 211 | // only protect Help pages on non-help-pages-fetching wikis |
212 | | - if ( $wgLanguageCode == "$language" && $wgDBname != $helpwiki ) { |
| 212 | + if ( $wgLanguageCode == $language && $wgDBname != $helpwiki ) { |
213 | 213 | // block actions 'edit' and 'create' |
214 | 214 | if ( $action != 'edit' && $action != 'create' ) { |
215 | 215 | return true; |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | $res = $dbr->select( |
220 | 220 | 'page', |
221 | 221 | array( 'page_title', 'page_namespace', 'page_latest' ), |
222 | | - array( 'page_namespace' => constant( 'NS_HELP' ), 'page_title' => str_replace( ' ', '_', $title->getText() ) ), |
| 222 | + array( 'page_namespace' => NS_HELP, 'page_title' => str_replace( ' ', '_', $title->getText() ) ), |
223 | 223 | __METHOD__ |
224 | 224 | ); |
225 | 225 | |
— | — | @@ -229,7 +229,7 @@ |
230 | 230 | $ns = $title->getNamespace(); |
231 | 231 | |
232 | 232 | // check namespaces |
233 | | - if( $ns == constant( 'NS_HELP' ) || $ns == constant( 'NS_HELP_TALK' ) ) { |
| 233 | + if( $ns == NS_HELP || $ns == NS_HELP_TALK ) { |
234 | 234 | // error message if action is blocked |
235 | 235 | $result = array( 'protectedpagetext' ); |
236 | 236 | |