- $content = $this->graby->fetchContent($url);
-
- // be sure to keep the url in case of error
- // so we'll be able to refetch it in the future
- $content['url'] = $content['url'] ?: $url;
-
- $this->stockEntry($entry, $content);
- }
-
- /**
- * Import entry using either fetched or provided content.
- *
- * @param Entry $entry Entry to update
- * @param array $content Array with content provided for import with AT LEAST keys title, html, url to skip the fetchContent from the url
- * @param bool $disableContentUpdate Whether to skip trying to fetch content using Graby
- */
- public function importEntry(Entry $entry, array $content, $disableContentUpdate = false)
- {
- try {
- $this->validateContent($content);
- } catch (\Exception $e) {
- // validation failed but do we want to disable updating content?
- if (true === $disableContentUpdate) {
- throw $e;
- }
+ if (!empty($content['html'])) {
+ $content['html'] = $this->graby->cleanupHtml($content['html'], $url);