Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -877,7 +877,8 @@ |
878 | 878 | if ( empty($last_row) ) { |
879 | 879 | $last_row = NULL; |
880 | 880 | } |
881 | | - $o = $this->printTableHtml( array_pop($tables) ) . $line; |
| 881 | + $curtable = array_pop($tables); |
| 882 | + $o = $this->printTableHtml( $curtable ) . $line; |
882 | 883 | |
883 | 884 | if ( count($tables) > 0 ) { |
884 | 885 | $table =& $this->last($tables); |
— | — | @@ -905,11 +906,11 @@ |
906 | 907 | if( $attributes !== '') { |
907 | 908 | $current_row['attributes'] = $attributes; |
908 | 909 | } |
909 | | - |
| 910 | + |
910 | 911 | } else if ( $first_chars === '|+' ) { |
911 | 912 | // a table caption |
912 | 913 | $line = substr ( $line , 2 ); |
913 | | - |
| 914 | + |
914 | 915 | $c = $this->getCellAttr($line , 'caption'); |
915 | 916 | $table['caption'] = array(); |
916 | 917 | $table['caption']['content'] = $c[0]; |
— | — | @@ -952,24 +953,25 @@ |
953 | 954 | unset($c); |
954 | 955 | } |
955 | 956 | $output =& $current_element['content']; |
956 | | - |
| 957 | + |
957 | 958 | } else { |
958 | 959 | $output .= $outLine."\n"; |
959 | 960 | } |
960 | 961 | } |
961 | | - |
| 962 | + |
962 | 963 | # Remove trailing line-ending (b/c) |
963 | 964 | if ( substr( $out, -1 ) === "\n" ) { |
964 | 965 | $out = substr( $out, 0, -1 ); |
965 | 966 | } |
966 | | - |
| 967 | + |
967 | 968 | #Close any unclosed tables |
968 | 969 | if (isset($tables) && count($tables) > 0 ) { |
969 | 970 | for ($i = 0; $i < count($tables); $i++) { |
970 | | - $out .= $this->printTableHtml( array_pop($tables) ); |
| 971 | + $curtable = array_pop($tables); |
| 972 | + $out .= $this->printTableHtml( $curtable ); |
971 | 973 | } |
972 | 974 | } |
973 | | - |
| 975 | + |
974 | 976 | wfProfileOut( __METHOD__ ); |
975 | 977 | |
976 | 978 | return $out; |
— | — | @@ -1033,7 +1035,7 @@ |
1034 | 1036 | $last_section = ''; |
1035 | 1037 | $empty = true; |
1036 | 1038 | $simple = true; |
1037 | | - |
| 1039 | + |
1038 | 1040 | //If we only have tbodies, mark table as simple |
1039 | 1041 | for($i = 0; isset($t[$i]); $i++ ) { |
1040 | 1042 | if ( !count( $t[$i]) ) continue; |
— | — | @@ -3531,7 +3533,7 @@ |
3532 | 3534 | # Update fetched file title |
3533 | 3535 | $title = $file->getTitle(); |
3534 | 3536 | } |
3535 | | - return array( $file, $title ); |
| 3537 | + return array( $file, $title ); |
3536 | 3538 | } |
3537 | 3539 | |
3538 | 3540 | /** |