r53437 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53436‎ | r53437 | r53438 >
Date:07:47, 18 July 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* Whitespace
* Post to $wgScript.. we do not need crawlers here
* E_NOTICE with unchecked use of explode results
Modified paths:
  • /trunk/phase3/includes/specials/SpecialAllmessages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialAllmessages.php
@@ -47,11 +47,13 @@
4848 }
4949
5050 function buildForm() {
51 - $url = $this->getTitle()->escapeLocalURL();
 51+ global $wgScript;
 52+
 53+ $action = htmlspecialchars( $wgScript );
5254 $languages = Language::getLanguageNames( false );
5355 ksort( $languages );
5456
55 - $out = "<form method=\"get\" action=\"$url\"><fieldset>\n" .
 57+ $out = "<form method=\"get\" action=\"$action\"><fieldset>\n" .
5658 Xml::hidden( 'title', $this->getTitle() ) .
5759 Xml::element( 'legend', null, wfMsg( 'allmessages' ) ) . "<table><tr>\n" .
5860 "<td class=\"mw-label\">" .
@@ -198,7 +200,7 @@
199201 if( $s->page_namespace == NS_MEDIAWIKI ){
200202 if( $this->foreign ){
201203 $title = explode( '/', $s->page_title );
202 - if( $this->langcode == $title[1] && array_key_exists( $title[0], $this->messages ) ){
 204+ if( count($title) === 2 && $this->langcode == $title[1] && array_key_exists( $title[0], $this->messages ) ){
203205 $this->messages["{$title[0]}"]['customised'] = 1;
204206 }
205207 } else if( array_key_exists( $s->page_title , $this->messages ) ){
@@ -230,7 +232,7 @@
231233 ( $descending && ( $key < $offset || !$offset ) || !$descending && $key > $offset ) &&
232234 (( $this->prefix && preg_match( $this->prefix, $key ) ) || $this->prefix === false )
233235 ){
234 - $mResult->result[] = array(
 236+ $mResult->result[] = array(
235237 'am_title' => $key,
236238 'am_actual' => $value['actual'],
237239 'am_default' => $value['default'],

Status & tagging log