Permalink
Browse files

Revert "Supporting different types of newlines."

This reverts commit 669a326.
  • Loading branch information...
1 parent 669a326 commit f41cb00e6290d2879b35819aa0455f891700e588 @waldoj waldoj committed Jan 1, 2013
Showing with 2 additions and 12 deletions.
  1. +2 −12 class.csv-to-api.php
View
@@ -47,7 +47,6 @@ function parse() {
// Create an instance of the parser for the requested file format (e.g. CSV)
$parser = 'parse_' . $this->source_format;
-
if ( !method_exists( $this, $parser ) ) {
header( '400 Bad Request' );
die( 'Format not supported' );
@@ -157,17 +156,8 @@ function xml_entities( $string ) {
* Turn CSV into a PHP array.
*/
function parse_csv( $csv ) {
- if ( substr_count($csv, "\n" ) > substr_count($csv, "\r" ) )
- {
- $newline = "\n";
- }
- else
- {
- $newline = "\r";
- }
-
- $lines = explode( $newline, $csv );
-
+
+ $lines = explode( "\n", $csv );
$headers = str_getcsv( array_shift( $lines ) );
$data = array();
foreach ( $lines as $line ) {

0 comments on commit f41cb00

Please sign in to comment.