You are here

protected function FetcherResult::sanitizeRaw in Feeds 8.3

Sanitizes the raw content string.

Currently supported sanitizations:

  • Remove BOM header from UTF-8 files.

Parameters

string $raw: The raw content string to be sanitized.

Return value

string The sanitized content as a string.

2 calls to FetcherResult::sanitizeRaw()
FetcherResult::getRaw in src/Result/FetcherResult.php
Returns the file provided by the fetcher as a string.
RawFetcherResult::getRaw in src/Result/RawFetcherResult.php
Returns the file provided by the fetcher as a string.

File

src/Result/FetcherResult.php, line 73

Class

FetcherResult
The default fetcher result object.

Namespace

Drupal\feeds\Result

Code

protected function sanitizeRaw($raw) {
  if (substr($raw, 0, 3) == pack('CCC', 0xef, 0xbb, 0xbf)) {
    $raw = substr($raw, 3);
  }
  return $raw;
}