* Prevent E_STRICT error when '$wgDebugDumpSql = true', and a path has been defined...
authorNick Jenkins <nickj@users.mediawiki.org>
Mon, 19 Mar 2007 07:08:58 +0000 (07:08 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Mon, 19 Mar 2007 07:08:58 +0000 (07:08 +0000)
  but $wgDebugLogFile does not exist yet: "filesize(): stat failed for sql-log.txt in includes/GlobalFunctions.php on line 219"
* Removing unused global $IP.
* Indentation of an if/else block.
* Trivial comment typo.
* Prevent PHP Fatal error: "Call to a member function getText() on a non-object in includes/SpecialListusers.php on line 46",
  when opening a URL such as http://192.168.0.64/wiki/index.php/Special:Listusers?username=%22%27%3E
  (i.e. when "Display users starting at:" username supplied in Special:Listusers is not a valid MediaWiki title).
* Fix HTML validation of protection form (i.e. when "action=protect").

includes/GlobalFunctions.php
includes/MimeMagic.php
includes/ProtectionForm.php
includes/SpecialListusers.php
includes/SpecialUndelete.php

index 878a6d6..8a39524 100644 (file)
@@ -22,7 +22,6 @@ $wgTotalViews = -1;
 $wgTotalEdits = -1;
 
 
-global $IP;
 require_once dirname(__FILE__) . '/LogPage.php';
 require_once dirname(__FILE__) . '/normal/UtfNormalUtil.php';
 require_once dirname(__FILE__) . '/XmlFunctions.php';
@@ -240,7 +239,7 @@ function wfLogDBError( $text ) {
 function wfErrorLog( $text, $file ) {
        wfSuppressWarnings();
        $exists = file_exists( $file );
-       $size = filesize( $file );
+       $size = $exists ? filesize( $file ) : false;
        if ( !$exists || ( $size !== false && $size + strlen( $text ) < 0x7fffffff ) ) {
                error_log( $text, 3, $file );
        }
index f70914b..2ef32c4 100644 (file)
@@ -339,7 +339,7 @@ class MimeMagic {
        }
 
 
-       /** mime type detection. This uses detectMimeType to detect the mim type of the file,
+       /** mime type detection. This uses detectMimeType to detect the mime type of the file,
        * but applies additional checks to determine some well known file formats that may be missed
        * or misinterpreter by the default mime detection (namely xml based formats like XHTML or SVG).
        *
index 662b1df..659ba1f 100644 (file)
@@ -213,14 +213,14 @@ class ProtectionForm {
                $out .= "</tbody>\n";
                $out .= "</table>\n";
 
-               $out .= "<table>\n";
-               $out .= "<tbody>\n";
-
                global $wgEnableCascadingProtection;
 
                if ($wgEnableCascadingProtection)
                        $out .= $this->buildCascadeInput();
 
+               $out .= "<table>\n";
+               $out .= "<tbody>\n";
+
                $out .= $this->buildExpiryInput();
 
                if( !$this->disabled ) {
@@ -285,8 +285,7 @@ class ProtectionForm {
 
        function buildCascadeInput() {
                $id = 'mwProtect-cascade';
-               $ci = "<tr>" . wfCheckLabel( wfMsg( 'protect-cascade' ), $id, $id, $this->mCascade, $this->disabledAttrib) . "</tr>";
-
+               $ci = wfCheckLabel( wfMsg( 'protect-cascade' ), $id, $id, $this->mCascade, $this->disabledAttrib);
                return $ci;
        }
 
index 8a05c38..f0ac125 100644 (file)
@@ -43,7 +43,9 @@ class UsersPager extends AlphabeticPager {
                $this->requestedUser = '';
                if ( $un != '' ) {
                        $username = Title::makeTitleSafe( NS_USER, $un );
-                       $this->requestedUser = $username->getText();
+                       if( ! is_null( $username ) ) {
+                               $this->requestedUser = $username->getText();
+                       }
                }
                parent::__construct();
        }
index 8aaf785..e450884 100644 (file)
@@ -773,10 +773,11 @@ class UndeleteForm {
                                $userLink = $sk->userLink( $row->ar_user, $row->ar_user_text ) . $sk->userToolLinks( $row->ar_user, $row->ar_user_text );
                                $stxt = '';
                                if (!is_null($size = $row->ar_len)) {
-                                       if ($size == 0)
-                                       $stxt = wfMsgHtml('historyempty');
-                               else
-                                       $stxt = wfMsgHtml('historysize', $wgLang->formatNum( $size ) );
+                                       if ($size == 0) {
+                                               $stxt = wfMsgHtml('historyempty');
+                                       } else {
+                                               $stxt = wfMsgHtml('historysize', $wgLang->formatNum( $size ) );
+                                       }
                                }
                                $comment = $sk->commentBlock( $row->ar_comment );
                                $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $stxt $comment</li>\n" );