From f5618feb73343f0a120a809116c443630d70a87c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 13 Mar 2015 23:33:49 +0100 Subject: fix #1154 --- inc/poche/Tools.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'inc/poche/Tools.class.php') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index d0b31d4f..c8fb2e52 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -392,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'); -- cgit v1.2.3 From d31766300a4c15acf0d6d496eb0156f2e6d3a269 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 22 May 2015 19:29:12 +0200 Subject: added Firefox-bookmarks format import mode --- inc/poche/Tools.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'inc/poche/Tools.class.php') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index c8fb2e52..1c554590 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -420,4 +420,15 @@ final class Tools return str_replace('+', '', $token); } + function get_doctype($doc) + { + $els = $doc->find('unknown'); + + foreach ($els as $e => $el) + if ($el->parent()->tag == 'root') + return $el; + + return NULL; + } + } -- cgit v1.2.3 From f0a819a968e5d935c757bb65acdfbca480398274 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 22 May 2015 20:09:23 +0200 Subject: added commentsand fixed something forgotten --- inc/poche/Tools.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'inc/poche/Tools.class.php') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 1c554590..f34e8beb 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -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'); -- cgit v1.2.3 From 3a690fad55cafb5b30debd1f3069e9c87b0a4b39 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 25 May 2015 20:44:22 +0200 Subject: declare function correctly --- inc/poche/Tools.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche/Tools.class.php') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index f34e8beb..f3d1013f 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -428,7 +428,7 @@ final class Tools * */ - function get_doctype($doc) + public static function get_doctype($doc) { $els = $doc->find('unknown'); -- cgit v1.2.3 From 6e22fc17d2df7f7c3636b9064c4016fefb88e7f9 Mon Sep 17 00:00:00 2001 From: Carsten Ringe Date: Tue, 9 Jun 2015 19:51:01 +0200 Subject: Use config option BASE_URL in getPocheUrl() --- inc/poche/Tools.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'inc/poche/Tools.class.php') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index d0b31d4f..d3dddd3b 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -72,8 +72,14 @@ final class Tools $serverport = ''; } - return 'http' . ($https ? 's' : '') . '://' - . $host . $serverport . $scriptname; + // check if BASE_URL is configured + if(BASE_URL != null && BASE_URL != '') { + $baseUrl = BASE_URL; + } else { + $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport; + } + + return $baseUrl . $scriptname; } /** -- cgit v1.2.3 From 984805649e38c0fc83cde0345ac99b74c8b66e61 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 29 Jun 2015 15:52:55 +0200 Subject: fix BASE_URL --- inc/poche/Tools.class.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'inc/poche/Tools.class.php') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 15050aed..6c176eae 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -40,6 +40,8 @@ final class Tools */ public static function getPocheUrl() { + $baseUrl = ""; + $https = (!empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on')) || (isset($_SERVER["SERVER_PORT"]) @@ -72,14 +74,16 @@ final class Tools $serverport = ''; } - // check if BASE_URL is configured - if(BASE_URL != null && BASE_URL != '') { - $baseUrl = BASE_URL; - } else { - $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport; - } + // 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; + return $baseUrl . $scriptname; + } /** -- cgit v1.2.3 From 85fb64c207df60bffef2688ef070bff59a6e6dbe Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 29 Jun 2015 15:57:19 +0200 Subject: delete the debug call --- inc/poche/Tools.class.php | 1 - 1 file changed, 1 deletion(-) (limited to 'inc/poche/Tools.class.php') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 6c176eae..9c748391 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -76,7 +76,6 @@ final class Tools // check if BASE_URL is configured if(BASE_URL) { - print_r(BASE_URL); $baseUrl = BASE_URL; } else { $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport; -- cgit v1.2.3