Index: trunk/phase3/includes/Parser.php |
— | — | @@ -2887,7 +2887,7 @@ |
2888 | 2888 | * @private |
2889 | 2889 | */ |
2890 | 2890 | function braceSubstitution( $piece ) { |
2891 | | - global $wgContLang, $wgLang, $wgAllowDisplayTitle; |
| 2891 | + global $wgContLang, $wgLang, $wgAllowDisplayTitle, $wgNonincludableNamespaces; |
2892 | 2892 | $fname = __METHOD__ /*. '-L' . count( $this->mArgStack )*/; |
2893 | 2893 | wfProfileIn( $fname ); |
2894 | 2894 | wfProfileIn( __METHOD__.'-setup' ); |
— | — | @@ -3065,6 +3065,9 @@ |
3066 | 3066 | $isHTML = true; |
3067 | 3067 | $this->disableCache(); |
3068 | 3068 | } |
| 3069 | + } else if ( $wgNonincludableNamespaces && in_array( $title->getNamespace(), $wgNonincludableNamespaces ) ) { |
| 3070 | + $found = false; //access denied |
| 3071 | + wfDebug( "$fname: template inclusion denied for " . $title->getPrefixedDBkey() ); |
3069 | 3072 | } else { |
3070 | 3073 | $articleContent = $this->fetchTemplate( $title ); |
3071 | 3074 | if ( $articleContent !== false ) { |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1038,6 +1038,13 @@ |
1039 | 1039 | $wgNamespaceProtection = array(); |
1040 | 1040 | $wgNamespaceProtection[ NS_MEDIAWIKI ] = array( 'editinterface' ); |
1041 | 1041 | |
| 1042 | +/** |
| 1043 | +* Pages in namespaces in this array can not be used as templates. |
| 1044 | +* Elements must be numeric namespace ids. |
| 1045 | +* Among other things, this may be useful to enforce read-restrictions |
| 1046 | +* which may otherwise be bypassed by using the template machanism. |
| 1047 | +*/ |
| 1048 | +$wgNonincludableNamespaces = array(); |
1042 | 1049 | |
1043 | 1050 | /** |
1044 | 1051 | * Number of seconds an account is required to age before |