http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90732
Revision: 90732
Author: aaron
Date: 2011-06-24 20:25:16 +0000 (Fri, 24 Jun 2011)
Log Message:
-----------
* Removed break in first loop of generateTableHTML(), which caused:
'<b>Notice</b>: Undefined index: type in
<b>C:\wamp\www\MW_trunk\includes\parser\Parser.php</b>
* Made some code simplifications
Modified Paths:
--------------
trunk/phase3/includes/parser/Parser.php
Modified: trunk/phase3/includes/parser/Parser.php
===================================================================
--- trunk/phase3/includes/parser/Parser.php 2011-06-24 19:54:25 UTC (rev
90731)
+++ trunk/phase3/includes/parser/Parser.php 2011-06-24 20:25:16 UTC (rev
90732)
@@ -1019,7 +1019,7 @@
*
* @private
*/
- function generateTableHTML ( &$table ) {
+ function generateTableHTML( &$table ) {
$return = "";
$return .= str_repeat( '<dl><dd>' , $table['indent'] );
$return .= '<table';
@@ -1041,22 +1041,20 @@
// If we only have tbodies, mark table as simple
for ( $i = 0; isset( $table[$i] ); $i++ ) {
if ( !count( $table[$i] ) ) continue;
- if ( !isset( $table[$i]['type'] ) ) $table[$i]['type']
= 'tbody';
+ if ( !isset( $table[$i]['type'] ) ) {
+ $table[$i]['type'] = 'tbody';
+ }
if ( !$lastSection ) {
$lastSection = $table[$i]['type'];
} elseif ( $lastSection != $table[$i]['type'] ) {
$simple = false;
- break;
}
}
$lastSection = '';
for ( $i = 0; isset( $table[$i] ); $i++ ) {
- // Check for empty tables
- if ( count( $table[$i] ) ) {
- $empty = false;
- } else {
- continue;
- }
+ if ( !count( $table[$i] ) ) continue;
+ $empty = false; // check for empty tables
+
if ( $table[$i]['type'] != $lastSection && !$simple ) {
$return .= "\n<" . $table[$i]['type'] . '>';
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs