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").
$wgTotalEdits = -1;
-global $IP;
require_once dirname(__FILE__) . '/LogPage.php';
require_once dirname(__FILE__) . '/normal/UtfNormalUtil.php';
require_once dirname(__FILE__) . '/XmlFunctions.php';
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 );
}
}
- /** 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).
*
$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 ) {
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;
}
$this->requestedUser = '';
if ( $un != '' ) {
$username = Title::makeTitleSafe( NS_USER, $un );
- $this->requestedUser = $username->getText();
+ if( ! is_null( $username ) ) {
+ $this->requestedUser = $username->getText();
+ }
}
parent::__construct();
}
$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" );