X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fpoche%2FTools.class.php;h=f3d1013fe52522f611fa8563d1c657c618fa6626;hb=c129374147de3da613bf10124778ee59070d2a66;hp=beb4f30ca9cec72a868d6760e933e07a9a6feb4c;hpb=2d4cfc58ec324987ad39365cbb3e4eb49df4e426;p=github%2Fwallabag%2Fwallabag.git diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index beb4f30c..f3d1013f 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -117,7 +117,7 @@ final class Tools { $views = array( 'install', 'import', 'export', 'config', 'tags', - 'edit-tags', 'view', 'login', 'error' + 'edit-tags', 'view', 'login', 'error', 'about', 'register' ); return (in_array($view, $views) ? $view . '.twig' : 'home.twig'); @@ -342,7 +342,10 @@ final class Tools return $json; }; - $json = $scope("inc/3rdparty/makefulltextfeed.php", array("url" => $url)); + // Silence $scope function to avoid + // issues with FTRSS when error_reporting is to high + // FTRSS generates PHP warnings which break output + $json = @$scope("inc/3rdparty/makefulltextfeed.php", array("url" => $url)); // Clearing and restoring context foreach ($GLOBALS as $key => $value) { @@ -389,8 +392,11 @@ final class Tools ); foreach ($files as $fileInfo) { - $todo = ($fileInfo->isDir() ? 'rmdir' : 'unlink'); - $todo($fileInfo->getRealPath()); + $filename = $fileInfo->getFilename(); + if (!$filename[0] == '.') { + $todo = ($fileInfo->isDir() ? 'rmdir' : 'unlink'); + $todo($fileInfo->getRealPath()); + } } Tools::logm('empty cache'); @@ -414,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; + } + }