Fix a couple of mistyped variable names, mysql strict incompatibilities, make cascadi...
authorAndrew Garrett <werdna@users.mediawiki.org>
Thu, 11 Jan 2007 01:17:19 +0000 (01:17 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Thu, 11 Jan 2007 01:17:19 +0000 (01:17 +0000)
includes/Article.php
includes/ProtectionForm.php

index b8ab922..9a7d629 100644 (file)
@@ -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__ );
index 1f71a1f..6004d04 100644 (file)
@@ -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;
        }