Fix XHTML tags
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 14 Oct 2004 05:53:30 +0000 (05:53 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 14 Oct 2004 05:53:30 +0000 (05:53 +0000)
includes/SpecialLockdb.php
includes/SpecialUnlockdb.php

index 363ac91..bbc8e7e 100644 (file)
@@ -16,7 +16,7 @@ function wfSpecialLockdb()
                $wgOut->developerRequired();
                return;
        }
-       $action = $wgRequest->getText( 'action' );
+       $action = $wgRequest->getVal( 'action' );
        $f = new DBLockForm();
 
        if ( "success" == $action ) { $f->showSuccess(); }
@@ -54,21 +54,27 @@ class DBLockForm {
                $titleObj = Title::makeTitle( NS_SPECIAL, "Lockdb" );
                $action = $titleObj->escapeLocalURL( "action=submit" );
 
-               $wgOut->addHTML( "<p>
-<form id=\"lockdb\" method=\"post\" action=\"{$action}\">
+               $wgOut->addHTML( <<<END
+<form id="lockdb" method="post" action="{$action}">
 {$elr}:
-<textarea name=\"wpLockReason\" rows=10 cols=60 wrap=virtual>
-</textarea>
-<table border=0><tr>
-<td align=right>
-<input type=checkbox name=\"wpLockConfirm\">
-</td>
-<td align=left>{$lc}<td>
-</tr><tr>
-<td>&nbsp;</td><td align=left>
-<input type=submit name=\"wpLock\" value=\"{$lb}\">
-</td></tr></table>
-</form>\n" );
+<textarea name="wpLockReason" rows="10" cols="60" wrap="virtual"></textarea>
+<table border="0">
+       <tr>
+               <td align="right">
+                       <input type="checkbox" name="wpLockConfirm" />
+               </td>
+               <td align="left">{$lc}</td>
+       </tr>
+       <tr>
+               <td>&nbsp;</td>
+               <td align="left">
+                       <input type="submit" name="wpLock" value="{$lb}" />
+               </td>
+       </tr>
+</table>
+</form>
+END
+);
 
        }
 
index 80ce71b..f2d056e 100644 (file)
@@ -15,11 +15,11 @@ function wfSpecialUnlockdb() {
                $wgOut->developerRequired();
                return;
        }
-       $action = $wgRequest->getText( 'action' );
+       $action = $wgRequest->getVal( 'action' );
        $f = new DBUnlockForm();
 
        if ( "success" == $action ) { $f->showSuccess(); }
-       else if ( "submit" == $action ) { $f->doSubmit(); }
+       else if ( "submit" == $action && $wgRequest->wasPosted() ) { $f->doSubmit(); }
        else { $f->showForm( "" ); }
 }
 
@@ -45,18 +45,26 @@ class DBUnlockForm {
                $titleObj = Title::makeTitle( NS_SPECIAL, "Unlockdb" );
                $action = $titleObj->escapeLocalURL( "action=submit" );
 
-               $wgOut->addHTML( "<p>
-<form id=\"unlockdb\" method=\"post\" action=\"{$action}\">
-<table border=0><tr>
-<td align=right>
-<input type=checkbox name=\"wpLockConfirm\">
-</td>
-<td align=\"left\">{$lc}<td>
-</tr><tr>
-<td>&nbsp;</td><td align=left>
-<input type=submit name=\"wpLock\" value=\"{$lb}\">
-</td></tr></table>
-</form>\n" );
+               $wgOut->addHTML( <<<END
+
+<form id="unlockdb" method="post" action="{$action}">
+<table border="0">
+       <tr>
+               <td align="right">
+                       <input type="checkbox" name="wpLockConfirm" />
+               </td>
+               <td align="left">{$lc}</td>
+       </tr>
+       <tr>
+               <td>&nbsp;</td>
+               <td align="left">
+                       <input type="submit" name="wpLock" value="{$lb}" />
+               </td>
+       </tr>
+</table>
+</form>
+END
+);
 
        }
 
@@ -69,7 +77,7 @@ class DBUnlockForm {
                        $this->showForm( wfMsg( "locknoconfirm" ) );
                        return;
                }
-               if ( ! unlink( $wgReadOnlyFile ) ) {
+               if ( @! unlink( $wgReadOnlyFile ) ) {
                        $wgOut->fileDeleteError( $wgReadOnlyFile );
                        return;
                }