]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Tools.class.php
fixed bug for #1242
[github/wallabag/wallabag.git] / inc / poche / Tools.class.php
index c8fb2e527ba2dfbba6b4d391cc69d864234ba76b..f3d1013fe52522f611fa8563d1c657c618fa6626 100755 (executable)
@@ -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;
+    }
+
 }