X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2Fpoche%2FTools.class.php;h=f3d1013fe52522f611fa8563d1c657c618fa6626;hb=c129374147de3da613bf10124778ee59070d2a66;hp=c8fb2e527ba2dfbba6b4d391cc69d864234ba76b;hpb=f5618feb73343f0a120a809116c443630d70a87c;p=github%2Fwallabag%2Fwallabag.git diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index c8fb2e52..f3d1013f 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -420,4 +420,23 @@ 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 + * + */ + + public static function get_doctype($doc) + { + $els = $doc->find('unknown'); + + foreach ($els as $e => $el) + if ($el->parent()->tag == 'root') + return $el; + + return NULL; + } + }