From 4e14efacc770cef51d86918efceefb23e853e675 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Thu, 11 Jan 2007 01:17:19 +0000 Subject: [PATCH] Fix a couple of mistyped variable names, mysql strict incompatibilities, make cascading protect checkbox disabled for users without protect permission. --- includes/Article.php | 6 +++++- includes/ProtectionForm.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index b8ab9227a5..9a7d629ca6 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1639,6 +1639,10 @@ class Article { return false; } + if (!$cascade) { + $cascade = false; + } + # FIXME: Same limitations as described in ProtectionForm.php (line 37); # we expect a single selection, but the schema allows otherwise. $current = array(); @@ -1672,7 +1676,7 @@ class Article { if ($restrictions != '' ) { $dbw->replace( 'page_restrictions', array( 'pr_pagetype'), array( 'pr_page' => $id, 'pr_type' => $action - , 'pr_level' => $restrictions, 'pr_cascade' => $cascade ), __METHOD__ ); + , 'pr_level' => $restrictions, 'pr_cascade' => $cascade ? 1 : 0 ), __METHOD__ ); } else { $dbw->delete( 'page_restrictions', array( 'pr_page' => $id, 'pr_type' => $action ), __METHOD__ ); diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 1f71a1fdfd..6004d046fe 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -215,7 +215,7 @@ class ProtectionForm { function buildCascadeInput() { $id = 'mwProtect-cascade'; - $ci = wfCheckLabel( wfMsg( 'protect-cascade' ), $id, $id, $this->mCascade, array ()); + $ci = wfCheckLabel( wfMsg( 'protect-cascade' ), $id, $id, $this->mCascade, $this->disabledAttrib); return $ci; } -- 2.20.1