- if($parametres_url = $url->fetchContent()) {
- if ($this->store->add($url->getUrl(), $parametres_url['title'], $parametres_url['content'], $this->user->getId())) {
- Tools::logm('add link ' . $url->getUrl());
- $sequence = '';
- if (STORAGE == 'postgres') {
- $sequence = 'entries_id_seq';
- }
- $last_id = $this->store->getLastId($sequence);
- if (DOWNLOAD_PICTURES) {
- $content = filtre_picture($parametres_url['content'], $url->getUrl(), $last_id);
- Tools::logm('updating content article');
- $this->store->updateContent($last_id, $content, $this->user->getId());
- }
- if (!$import) {
- $this->messages->add('s', _('the link has been added successfully'));
- }
+ $content = $url->extract();
+
+ if ($this->store->add($url->getUrl(), $content['title'], $content['body'], $this->user->getId())) {
+ Tools::logm('add link ' . $url->getUrl());
+ $sequence = '';
+ if (STORAGE == 'postgres') {
+ $sequence = 'entries_id_seq';