r19094 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19093‎ | r19094 | r19095 >
Date:23:17, 10 January 2007
Author:werdna
Status:old
Tags:
Comment:
Various bugfixes for Bad Stuff found in testing.. should be ready for a branch merge.
Modified paths:
  • /branches/werdna/restrictions-separation/includes/Article.php (modified) (history)
  • /branches/werdna/restrictions-separation/includes/OutputPage.php (modified) (history)
  • /branches/werdna/restrictions-separation/includes/ProtectionForm.php (modified) (history)
  • /branches/werdna/restrictions-separation/includes/Title.php (modified) (history)
  • /branches/werdna/restrictions-separation/maintenance/archives/patch-page_restrictions.sql (modified) (history)

Diff [purge]

Index: branches/werdna/restrictions-separation/maintenance/archives/patch-page_restrictions.sql
@@ -19,8 +19,4 @@
2020 KEY pr_typelevel (pr_type,pr_level),
2121 KEY pr_level (pr_level),
2222 KEY pr_cascade (pr_cascade)
23 -) TYPE=InnoDB;
24 -
25 -ALTER TABLE /*$wgDBprefix*/page
26 - ALTER COLUMN page_restrictions
27 - SET DEFAULT '';
\ No newline at end of file
 23+) TYPE=InnoDB;
\ No newline at end of file
Index: branches/werdna/restrictions-separation/includes/ProtectionForm.php
@@ -25,7 +25,7 @@
2626 class ProtectionForm {
2727 var $mRestrictions = array();
2828 var $mReason = '';
29 - var $mCascade = 0;
 29+ var $mCascade = false;
3030
3131 function ProtectionForm( &$article ) {
3232 global $wgRequest, $wgUser;
@@ -151,6 +151,8 @@
152152 $out .= "</tbody>\n";
153153 $out .= "</table>\n";
154154
 155+ global $wgEnableCascadingProtection;
 156+
155157 if ($wgEnableCascadingProtection)
156158 $out .= $this->buildCascadeInput();
157159
@@ -214,8 +216,8 @@
215217 function buildCascadeInput() {
216218 $id = 'mwProtect-cascade';
217219 $ci = wfCheckLabel( wfMsg( 'protect-cascade' ), $id, $id, $this->mCascade, array ());
218 - $id = 'mwProtect-cascadeonly';
219 - $ci .= wfCheckLabel( wfMsg( 'protect-cascadeonly' ), $id, $id, $this->mCascade, array ());
 220+
 221+ return $ci;
220222 }
221223
222224 function buildSubmit() {
Index: branches/werdna/restrictions-separation/includes/Article.php
@@ -1649,6 +1649,7 @@
16501650 $updated = Article::flattenRestrictions( $limit );
16511651
16521652 $changed = ( $current != $updated );
 1653+ $changed = $changed || ($this->mTitle->getRestrictionCascadingFlags() != $cascade);
16531654 $protect = ( $updated != '' );
16541655
16551656 # If nothing's changed, do nothing
@@ -1671,8 +1672,7 @@
16721673 if ($restrictions != '' ) {
16731674 $dbw->replace( 'page_restrictions', array( 'pr_pagetype'),
16741675 array( 'pr_page' => $id, 'pr_type' => $action
1675 - , 'pr_level' => $restrictions, 'pr_cascade' => $cascade ), __METHOD__
1676 -);
 1676+ , 'pr_level' => $restrictions, 'pr_cascade' => $cascade ), __METHOD__ );
16771677 } else {
16781678 $dbw->delete( 'page_restrictions', array( 'pr_page' => $id,
16791679 'pr_type' => $action ), __METHOD__ );
Index: branches/werdna/restrictions-separation/includes/OutputPage.php
@@ -319,7 +319,7 @@
320320 addWikiTextTitle( $text, $title, $linestart, true );
321321 }
322322
323 - private function addWikiTextTitle($text, &$title, $linestart, $tidy = false) {
 323+ public function addWikiTextTitle($text, &$title, $linestart, $tidy = false) {
324324 global $wgParser;
325325
326326 $fname = 'OutputPage:addWikiTextTitle';
Index: branches/werdna/restrictions-separation/includes/Title.php
@@ -1118,7 +1118,7 @@
11191119 }
11201120
11211121 if ( ( $this->isCascadeProtectedPage() ) ||
1122 - ($this->getNamespace == NS_IMAGE && $this->isCascadeProtectedImage() ) ) {
 1122+ ($this->getNamespace() == NS_IMAGE && $this->isCascadeProtectedImage() ) ) {
11231123 # We /could/ use the protection level on the source page, but it's fairly ugly
11241124 # as we have to establish a precedence hierarchy for pages included by multiple
11251125 # cascade-protected pages. So just restrict it to people with 'protect' permission,