summaryrefslogtreecommitdiff
path: root/importNetscape.php
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-09-11 14:08:58 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-09-11 14:08:58 +0000
commitc8a27226eef8e7e492450e39ae972e1ec11ee410 (patch)
tree50960edc82f59f89217146d181d990c2526e03cb /importNetscape.php
parent91ade3298a1c246dc2440948be11820ff2c61393 (diff)
downloadsemanticscuttle-c8a27226eef8e7e492450e39ae972e1ec11ee410.tar.gz
semanticscuttle-c8a27226eef8e7e492450e39ae972e1ec11ee410.tar.bz2
Big fix: for import local bookmarks like place: or javascript: (firefox 3 case)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@143 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'importNetscape.php')
-rw-r--r--importNetscape.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/importNetscape.php b/importNetscape.php
index 6682ec0..97f458f 100644
--- a/importNetscape.php
+++ b/importNetscape.php
@@ -63,16 +63,20 @@ if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['si
if ($bookmarkservice->bookmarkExists($bAddress, $userservice->getCurrentUserId())) {
$tplVars['error'] = T_('You have already submitted this bookmark.');
} else {
- // If bookmark claims to be from the future, set it to be now instead
- if (strtotime($bDatetime) > time()) {
- $bDatetime = gmdate('Y-m-d H:i:s');
- }
+ // If bookmark is local (like javascript: or place: in Firefox3), do nothing
+ if(substr($bAddress, 0, 7) == "http://") {
- if ($bookmarkservice->addBookmark($bAddress, $bTitle, NULL, $status, NULL, $bDatetime, false, true)) {
- $tplVars['msg'] = T_('Bookmark imported.');
- } else {
- $tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.');
- }
+ // If bookmark claims to be from the future, set it to be now instead
+ if (strtotime($bDatetime) > time()) {
+ $bDatetime = gmdate('Y-m-d H:i:s');
+ }
+
+ if ($bookmarkservice->addBookmark($bAddress, $bTitle, NULL, $status, NULL, $bDatetime, false, true)) {
+ $tplVars['msg'] = T_('Bookmark imported.');
+ } else {
+ $tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.');
+ }
+ }
}
}
header('Location: '. createURL('bookmarks', $userinfo[$userservice->getFieldName('username')]));