Fix Special:Import for new schema; make it create page records as needed and hook...
[lhc/web/wiklou.git] / includes / Parser.php
index 0a19fb0..fbc7b28 100644 (file)
@@ -249,7 +249,7 @@ class Parser
 
                while ( '' != $text ) {
                        if($tag==STRIP_COMMENTS) {
-                               $p = preg_split( '/<!--/i', $text, 2 );
+                               $p = preg_split( '/<!--/', $text, 2 );
                        } else {
                                $p = preg_split( "/<\\s*$tag\\s*>/i", $text, 2 );
                        }
@@ -552,7 +552,7 @@ class Parser
                        }
                        else if ( count ( $td ) == 0 ) { } # Don't do any of the following
                        else if ( '|}' == substr ( $x , 0 , 2 ) ) {
-                               $z = "</table>\n" ;
+                               $z = "</table>" . substr ( $x , 2) . "\n";
                                $l = array_pop ( $ltd ) ;
                                if ( array_pop ( $tr ) ) $z = '</tr>' . $z ;
                                if ( array_pop ( $td ) ) $z = '</'.$l.'>' . $z ;
@@ -2770,16 +2770,11 @@ class Parser
                                        # Not in the link cache, add it to the query
                                        if ( !isset( $current ) ) {
                                                $current = $val;
-                                               $tables = $page;
-                                               $join = '';
                                                $query =  "SELECT page_id, page_namespace, page_title";
                                                if ( $threshold > 0 ) {
-                                                       $textTable = $dbr->tableName( 'text' );
-                                                       $query .= ', LENGTH(old_text) AS page_len, page_is_redirect';
-                                                       $tables .= ", $textTable";
-                                                       $join = 'page_latest=old_id AND';
+                                                       $query .= ', page_len, page_is_redirect';
                                                }
-                                               $query .= " FROM $tables WHERE $join (page_namespace=$val AND page_title IN(";
+                                               $query .= " FROM $page WHERE (page_namespace=$val AND page_title IN(";
                                        } elseif ( $current != $val ) {
                                                $current = $val;
                                                $query .= ")) OR (page_namespace=$val AND page_title IN(";