You are here

public function FeedsFetcherResult::sanitizeRaw in Feeds 8.2

Sanitize 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

The sanitized content as a string.

3 calls to FeedsFetcherResult::sanitizeRaw()
FeedsFetcherResult::getRaw in lib/Drupal/feeds/FeedsFetcherResult.php
FeedsFileFetcherResult::getRaw in lib/Drupal/feeds/FeedsFileFetcherResult.php
Overrides parent::getRaw().
FeedsHTTPFetcherResult::getRaw in lib/Drupal/feeds/FeedsHTTPFetcherResult.php
Overrides FeedsFetcherResult::getRaw();

File

lib/Drupal/feeds/FeedsFetcherResult.php, line 71

Class

FeedsFetcherResult
Base class for all fetcher results.

Namespace

Drupal\feeds

Code

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