Index: trunk/phase3/includes/Title.php |
— | — | @@ -1148,7 +1148,7 @@ |
1149 | 1149 | return $result; |
1150 | 1150 | } |
1151 | 1151 | |
1152 | | - if( $wgUser->isAllowed('read') ) { |
| 1152 | + if( $wgUser->isAllowed( 'read' ) ) { |
1153 | 1153 | return true; |
1154 | 1154 | } else { |
1155 | 1155 | global $wgWhitelistRead; |
— | — | @@ -1160,19 +1160,35 @@ |
1161 | 1161 | if( $this->isSpecial( 'Userlogin' ) || $this->isSpecial( 'Resetpass' ) ) { |
1162 | 1162 | return true; |
1163 | 1163 | } |
1164 | | - |
1165 | | - /** some pages are explicitly allowed */ |
| 1164 | + |
| 1165 | + /** |
| 1166 | + * Check for explicit whitelisting |
| 1167 | + */ |
1166 | 1168 | $name = $this->getPrefixedText(); |
1167 | | - if( $wgWhitelistRead && in_array( $name, $wgWhitelistRead ) ) { |
| 1169 | + if( $wgWhitelistRead && in_array( $name, $wgWhitelistRead, true ) ) |
1168 | 1170 | return true; |
1169 | | - } |
1170 | | - |
1171 | | - # Compatibility with old settings |
| 1171 | + |
| 1172 | + /** |
| 1173 | + * Old settings might have the title prefixed with |
| 1174 | + * a colon for main-namespace pages |
| 1175 | + */ |
1172 | 1176 | if( $wgWhitelistRead && $this->getNamespace() == NS_MAIN ) { |
1173 | | - if( in_array( ':' . $name, $wgWhitelistRead ) ) { |
| 1177 | + if( in_array( ':' . $name, $wgWhitelistRead ) ) |
1174 | 1178 | return true; |
1175 | | - } |
1176 | 1179 | } |
| 1180 | + |
| 1181 | + /** |
| 1182 | + * If it's a special page, ditch the subpage bit |
| 1183 | + * and check again |
| 1184 | + */ |
| 1185 | + if( $this->getNamespace() == NS_SPECIAL ) { |
| 1186 | + $name = $this->getText(); |
| 1187 | + list( $name, $subpage ) = SpecialPage::resolveAliasWithSubpage( $name ); |
| 1188 | + $pure = SpecialPage::getTitleFor( $name )->getPrefixedText(); |
| 1189 | + if( in_array( $pure, $wgWhitelistRead, true ) ) |
| 1190 | + return true; |
| 1191 | + } |
| 1192 | + |
1177 | 1193 | } |
1178 | 1194 | return false; |
1179 | 1195 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -234,6 +234,10 @@ |
235 | 235 | * (bug 10401) Provide non-redirecting link to original title in Special:Movepage |
236 | 236 | * Fix broken handling of log views for page titles consisting of one |
237 | 237 | or more zeros, e.g. "0", "00" etc. |
| 238 | +* Fix read permission check for special pages with subpage parameters, e.g. |
| 239 | + Special:Confirmemail |
| 240 | +* Fix read permission check for page titles consisting of one or more zeros, |
| 241 | + e.g. "0", "00" etc. |
238 | 242 | |
239 | 243 | == API changes since 1.10 == |
240 | 244 | |