*/
public static function getPocheUrl()
{
+ $baseUrl = "";
+
$https = (!empty($_SERVER['HTTPS'])
&& (strtolower($_SERVER['HTTPS']) == 'on'))
|| (isset($_SERVER["SERVER_PORT"])
$serverport = (!isset($_SERVER["SERVER_PORT"])
|| $_SERVER["SERVER_PORT"] == '80'
+ || $_SERVER["SERVER_PORT"] == HTTP_PORT
|| ($https && $_SERVER["SERVER_PORT"] == '443')
|| ($https && $_SERVER["SERVER_PORT"]==SSL_PORT) //Custom HTTPS port detection
? '' : ':' . $_SERVER["SERVER_PORT"]);
$serverport = '';
}
- return 'http' . ($https ? 's' : '') . '://'
- . $host . $serverport . $scriptname;
+ // check if BASE_URL is configured
+ if(BASE_URL) {
+ print_r(BASE_URL);
+ $baseUrl = BASE_URL;
+ } else {
+ $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport;
+ }
+
+ return $baseUrl . $scriptname;
+
}
/**
{
$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');
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) {
);
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');
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;
+ }
+
}