public function FeedsFetcherResult::sanitizeRawOptimized in Feeds 7.2
Sanitize the raw content string.
Currently supported sanitizations:
- Remove BOM header from UTF-8 files.
This accepts the raw contents by reference to prevent having the whole raw contents in memory again.
Parameters
string $raw: The raw content string to be sanitized.
Return value
string The sanitized content as a string.
2 calls to FeedsFetcherResult::sanitizeRawOptimized()
- FeedsFetcherResult::getRaw in plugins/
FeedsFetcher.inc - Returns the raw content.
- FeedsHTTPFetcherResult::getRaw in plugins/
FeedsHTTPFetcher.inc - Overrides FeedsFetcherResult::getRaw().
File
- plugins/
FeedsFetcher.inc, line 241 - Contains the FeedsFetcher and related classes.
Class
- FeedsFetcherResult
- Base class for all fetcher results.
Code
public function sanitizeRawOptimized(&$raw) {
if (substr($raw, 0, 3) == pack('CCC', 0xef, 0xbb, 0xbf)) {
$raw = substr($raw, 3);
}
return $raw;
}