aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/NetscapeBookmarkUtils.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-02-23 20:34:06 +0100
committerArthurHoaro <arthur@hoa.ro>2018-02-23 20:34:06 +0100
commit3ff1ce47bc9e512ae67b009296c8ac7a6654c9ad (patch)
treeee6f46f786513fbec800fb2fac02ff8776c410b9 /application/NetscapeBookmarkUtils.php
parentb9c6589363f3a9b86fd64a96dfbafcdeb9f42c77 (diff)
downloadShaarli-3ff1ce47bc9e512ae67b009296c8ac7a6654c9ad.tar.gz
Shaarli-3ff1ce47bc9e512ae67b009296c8ac7a6654c9ad.tar.zst
Shaarli-3ff1ce47bc9e512ae67b009296c8ac7a6654c9ad.zip
Ignore the case while checking DOCTYPE during the file import
Fixes #1091
Diffstat (limited to 'application/NetscapeBookmarkUtils.php')
-rw-r--r--application/NetscapeBookmarkUtils.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php
index dd7057f8..2aa2da3b 100644
--- a/application/NetscapeBookmarkUtils.php
+++ b/application/NetscapeBookmarkUtils.php
@@ -108,7 +108,7 @@ class NetscapeBookmarkUtils
108 $filesize = $files['filetoupload']['size']; 108 $filesize = $files['filetoupload']['size'];
109 $data = file_get_contents($files['filetoupload']['tmp_name']); 109 $data = file_get_contents($files['filetoupload']['tmp_name']);
110 110
111 if (strpos($data, '<!DOCTYPE NETSCAPE-Bookmark-file-1>') === false) { 111 if (preg_match('/<!DOCTYPE NETSCAPE-Bookmark-file-1>/i', $data) === 0) {
112 return self::importStatus($filename, $filesize); 112 return self::importStatus($filename, $filesize);
113 } 113 }
114 114
@@ -160,7 +160,7 @@ class NetscapeBookmarkUtils
160 } else if ($post['privacy'] == 'public') { 160 } else if ($post['privacy'] == 'public') {
161 // all imported links are public 161 // all imported links are public
162 $private = 0; 162 $private = 0;
163 } 163 }
164 164
165 $newLink = array( 165 $newLink = array(
166 'title' => $bkm['title'], 166 'title' => $bkm['title'],