diff options
| author | 2012-11-07 19:04:00 +0100 | |
|---|---|---|
| committer | 2012-11-07 19:04:00 +0100 | |
| commit | 85cc23fb4fde71809a6e510dabb66a7e4d612233 (patch) | |
| tree | 932dbab32fb84f727dc272d02f1e00c69fcaa5bb /lib/lib_rss.php | |
| parent | 567d19a98934747d0817ad58a008dce7d5df0d92 (diff) | |
Fix bug get_content_by_parsing()
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 8f4b6cc3a..f0a65fa49 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -190,17 +190,16 @@ function good_bye_extra ($element) { } /* permet de récupérer le contenu d'un article pour un flux qui n'est pas complet */ function get_content_by_parsing ($url, $path) { - $content = new simple_html_dom (); - $content->set_callback ('good_bye_extra'); - $ok = $content->load_file ($url); + $html = new simple_html_dom (); + $html->set_callback ('good_bye_extra'); + $ok = $html->load_file ($url); if ($ok !== false) { - // Le __toString () permet d'écraser le DOM (on n'en a plus besoin) - // une autre solution serait $content->clear () qui vide le dom - $content = $content->find ($path, 0)->__toString (); + $content = $html->find ($path, 0); + $html->clear (); if ($content) { - return $content; + return $content->__toString (); } else { throw new Exception (); } |
