Un-break large number of actions. Timwi, please read http://www.php.net/switch
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Apr 2004 10:46:28 +0000 (10:46 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Apr 2004 10:46:28 +0000 (10:46 +0000)
index.php

index 608bbac..6a811df 100644 (file)
--- a/index.php
+++ b/index.php
@@ -103,7 +103,7 @@ if ( $search = $wgRequest->getText( 'search' ) ) {
                case "rollback":
                case "protect":
                case "unprotect":
-                       $wgArticle->unprotect();
+                       $wgArticle->$action();
                        break;
                case "print":
                        $wgArticle->view();
@@ -131,7 +131,7 @@ if ( $search = $wgRequest->getText( 'search' ) ) {
                        }
                        include_once( "EditPage.php" );
                        $editor = new EditPage( $wgArticle );
-                       $editor->submit();
+                       $editor->$action();
                        break;
                case "history":
                        if ($_SERVER["REQUEST_URI"] == $wgTitle->getInternalURL('action=history')) {