Feature #272 - Internationalization library: Correction in the function api_fgetcsv(), removing "\r" or "\n" characters at the end of the processed line.

skala
Ivan Tcholakov 15 years ago
parent 176741902e
commit 55aa7d719e
  1. 1
      main/inc/lib/internationalization.lib.php

@ -3812,6 +3812,7 @@ function & api_str_getcsv(& $string, $delimiter = ',', $enclosure = '"', $escape
*/
function api_fgetcsv($handle, $length = null, $delimiter = ',', $enclosure = '"', $escape = '\\') {
if (($line = is_null($length) ? fgets($handle): fgets($handle, $length)) !== false) {
$line = rtrim($line, "\r\n");
return api_str_getcsv($line, $delimiter, $enclosure, $escape);
}
return false;

Loading…
Cancel
Save