added commentsand fixed something forgotten

This commit is contained in:
Thomas Citharel 2015-05-22 20:09:23 +02:00
parent d31766300a
commit f0a819a968
2 changed files with 9 additions and 1 deletions

View file

@ -733,7 +733,7 @@ class Poche
$data = array();
$read = 0;
if (Tools:: get_doctype($html)) {
if (Tools::get_doctype($html)->innertext == "<!DOCTYPE NETSCAPE-Bookmark-file-1>") {
// Firefox-bookmarks HTML
foreach (array('DL','ul') as $list) {
foreach ($html->find($list) as $ul) {

View file

@ -420,6 +420,14 @@ final class Tools
return str_replace('+', '', $token);
}
/**
*
* Returns the doctype for an HTML document (used for Mozilla Bookmarks)
* @param simple_html_dom $doc
* @return doctype $el
*
*/
function get_doctype($doc)
{
$els = $doc->find('unknown');