Index: trunk/extensions/DataTransfer/specials/DT_ImportCSV.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | |
9 | 9 | if ( !defined( 'MEDIAWIKI' ) ) die(); |
10 | 10 | |
11 | | -class DTPage { |
| 11 | +class DTPage { |
12 | 12 | var $mName; |
13 | 13 | var $mTemplates; |
14 | 14 | var $mFreeText; |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | array( 'name' => 'encoding' ), |
121 | 121 | "\n" . $utf8OptionText . $utf16OptionText. "\t" ) . "\n\t"; |
122 | 122 | $formText .= "\t" . Xml::tags( 'p', null, wfMsg( 'dt_import_encodingtype', 'CSV' ) . " " . $encodingSelectText ) . "\n"; |
123 | | - $formText .= "\t" . '<hr style="margin: 10px 0 10px 0" />' . "\n"; |
| 123 | + $formText .= "\t" . '<hr style="margin: 10px 0 10px 0" />' . "\n"; |
124 | 124 | $formText .= DTUtils::printExistingPagesHandling(); |
125 | 125 | $formText .= DTUtils::printImportSummaryInput( 'CSV' ); |
126 | 126 | $formText .= DTUtils::printSubmitButton(); |
— | — | @@ -169,12 +169,15 @@ |
170 | 170 | $byteOrderMark = pack( "CCC", 0xef, 0xbb, 0xbf ); |
171 | 171 | if ( 0 == strncmp( $table[0][0], $byteOrderMark, 3 ) ) { |
172 | 172 | $table[0][0] = substr( $table[0][0], 3 ); |
| 173 | + // If there were quotation marks around this value, |
| 174 | + // they didn't get removed, so remove them now. |
| 175 | + $table[0][0] = trim( $table[0][0], '"' ); |
173 | 176 | } |
174 | 177 | |
175 | 178 | // check header line to make sure every term is in the |
176 | 179 | // correct format |
177 | | - $title_label = wfMsgForContent( 'dt_xml_title' ); |
178 | | - $free_text_label = wfMsgForContent( 'dt_xml_freetext' ); |
| 180 | + $title_label = wfMsgForContent( 'dt_xml_title' ); |
| 181 | + $free_text_label = wfMsgForContent( 'dt_xml_freetext' ); |
179 | 182 | foreach ( $table[0] as $i => $header_val ) { |
180 | 183 | if ( $header_val !== $title_label && $header_val !== $free_text_label && |
181 | 184 | ! preg_match( '/^[^\[\]]+\[[^\[\]]+]$/', $header_val ) ) { |
— | — | @@ -219,7 +222,7 @@ |
220 | 223 | $jobs[] = new DTImportJob( $title, $jobParams ); |
221 | 224 | } |
222 | 225 | Job::batchInsert( $jobs ); |
223 | | - $text .= wfMsgExt( 'dt_import_success', array( 'parse' ), $wgLang->formatNum( count( $jobs ) ), 'CSV' ); |
| 226 | + $text .= wfMsgExt( 'dt_import_success', array( 'parse' ), $wgLang->formatNum( count( $jobs ) ), 'CSV' ); |
224 | 227 | |
225 | 228 | return $text; |
226 | 229 | } |