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
This commit is contained in:
parent
91ade3298a
commit
c8a27226ee
1 changed files with 13 additions and 9 deletions
|
@ -63,16 +63,20 @@ if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['si
|
||||||
if ($bookmarkservice->bookmarkExists($bAddress, $userservice->getCurrentUserId())) {
|
if ($bookmarkservice->bookmarkExists($bAddress, $userservice->getCurrentUserId())) {
|
||||||
$tplVars['error'] = T_('You have already submitted this bookmark.');
|
$tplVars['error'] = T_('You have already submitted this bookmark.');
|
||||||
} else {
|
} else {
|
||||||
// If bookmark claims to be from the future, set it to be now instead
|
// If bookmark is local (like javascript: or place: in Firefox3), do nothing
|
||||||
if (strtotime($bDatetime) > time()) {
|
if(substr($bAddress, 0, 7) == "http://") {
|
||||||
$bDatetime = gmdate('Y-m-d H:i:s');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($bookmarkservice->addBookmark($bAddress, $bTitle, NULL, $status, NULL, $bDatetime, false, true)) {
|
// If bookmark claims to be from the future, set it to be now instead
|
||||||
$tplVars['msg'] = T_('Bookmark imported.');
|
if (strtotime($bDatetime) > time()) {
|
||||||
} else {
|
$bDatetime = gmdate('Y-m-d H:i:s');
|
||||||
$tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.');
|
}
|
||||||
}
|
|
||||||
|
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')]));
|
header('Location: '. createURL('bookmarks', $userinfo[$userservice->getFieldName('username')]));
|
||||||
|
|
Loading…
Reference in a new issue